keyword overwrite

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Urs Vogel

    #1

    keyword overwrite

    Hi

    For compatibilty reasons with an older system, I need to have a method
    called string()
    ..
    In VB.Net I may use [keyword] names for my own functions, such as

    Public Function [String](ByVal s as String) as String
    .....

    In C#,

    public string string(string s) // function must have the name string

    of course won't work. Any hints of how to solve this problem?

    Thanks,
    Urs


  • Chris R. Timmons

    #2
    Re: keyword overwrite

    "Urs Vogel" <ursvogel@yahoo .com> wrote in
    news:esYTFtWeDH A.3280@tk2msftn gp13.phx.gbl:
    [color=blue]
    > Hi
    >
    > For compatibilty reasons with an older system, I need to have a
    > method called string()
    > .
    > In VB.Net I may use [keyword] names for my own functions, such
    > as
    >
    > Public Function [String](ByVal s as String) as String
    > ....
    >
    > In C#,
    >
    > public string string(string s) // function must have the name
    > string
    >
    > of course won't work. Any hints of how to solve this problem?[/color]

    Urs,

    Preface the identifier with the @ symbol:

    public string @string(string s)

    Hope this helps.

    Chris.
    -------------
    C.R. Timmons Consulting, Inc.

    Comment

    • Urs Vogel

      #3
      Re: keyword overwrite

      Chris, that's exactly it, perfect, thanks.

      "Chris R. Timmons" <crtimmons@X_NO SPAM_Xcrtimmons inc.com> schrieb im
      Newsbeitrag news:Xns93F4AC6 36D48Acrtimmons crtimmonsin@207 .46.248.16...[color=blue]
      > "Urs Vogel" <ursvogel@yahoo .com> wrote in
      > news:esYTFtWeDH A.3280@tk2msftn gp13.phx.gbl:
      >[color=green]
      > > Hi
      > >
      > > For compatibilty reasons with an older system, I need to have a
      > > method called string()
      > > .
      > > In VB.Net I may use [keyword] names for my own functions, such
      > > as
      > >
      > > Public Function [String](ByVal s as String) as String
      > > ....
      > >
      > > In C#,
      > >
      > > public string string(string s) // function must have the name
      > > string
      > >
      > > of course won't work. Any hints of how to solve this problem?[/color]
      >
      > Urs,
      >
      > Preface the identifier with the @ symbol:
      >
      > public string @string(string s)
      >
      > Hope this helps.
      >
      > Chris.
      > -------------
      > C.R. Timmons Consulting, Inc.
      > http://www.crtimmonsinc.com/[/color]


      Comment

      Working...