Find Equal value of a integer to a string

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • El Camino

    Find Equal value of a integer to a string

    Lets say i have :

    intID=1

    I need to switch that integer to 'A'

    If i have intID=2 then need to switch to 'B'

    If i have intID=3 then need to switch to 'C'

    and so on..

    Is there a quick way to that beside goiing threw and
    extensive selection process
  • David Ricker

    #2
    Re: Find Equal value of a integer to a string

    Microsoft.Visua lBasic.Chr(1 + 64).ToString = A

    Microsoft.Visua lBasic.Chr(2 + 64).ToString = B

    Microsoft.Visua lBasic.Chr(3 + 64).ToString = C

    Hope this helps.





    "El Camino" <anonymous@disc ussions.microso ft.com> wrote in message
    news:01fe01c3bd cd$cc1a0af0$a50 1280a@phx.gbl.. .
    [color=blue]
    > Lets say i have :
    >
    > intID=1
    >
    > I need to switch that integer to 'A'
    >
    > If i have intID=2 then need to switch to 'B'
    >
    > If i have intID=3 then need to switch to 'C'
    >
    > and so on..
    >
    > Is there a quick way to that beside goiing threw and
    > extensive selection process[/color]


    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Find Equal value of a integer to a string

      * "El Camino" <anonymous@disc ussions.microso ft.com> scripsit:[color=blue]
      > Lets say i have :
      >
      > intID=1
      >
      > I need to switch that integer to 'A'
      >
      > If i have intID=2 then need to switch to 'B'
      >
      > If i have intID=3 then need to switch to 'C'
      >
      > and so on..
      >
      > Is there a quick way to that beside goiing threw and
      > extensive selection process[/color]

      You can use 'Chr(64 + intID)'.

      --
      Herfried K. Wagner [MVP]
      <http://www.mvps.org/dotnet>

      Comment

      • Guest's Avatar

        #4
        Re: Find Equal value of a integer to a string

        It works great!
        Thanks a lot
        El Camino[color=blue]
        >-----Original Message-----
        >Microsoft.Visu alBasic.Chr(1 + 64).ToString = A
        >
        >Microsoft.Visu alBasic.Chr(2 + 64).ToString = B
        >
        >Microsoft.Visu alBasic.Chr(3 + 64).ToString = C
        >
        >Hope this helps.
        >
        >
        >
        >
        >
        >"El Camino" <anonymous@disc ussions.microso ft.com> wrote[/color]
        in message[color=blue]
        >news:01fe01c3b dcd$cc1a0af0$a5 01280a@phx.gbl. ..
        >[color=green]
        >> Lets say i have :
        >>
        >> intID=1
        >>
        >> I need to switch that integer to 'A'
        >>
        >> If i have intID=2 then need to switch to 'B'
        >>
        >> If i have intID=3 then need to switch to 'C'
        >>
        >> and so on..
        >>
        >> Is there a quick way to that beside goiing threw and
        >> extensive selection process[/color]
        >
        >
        >.
        >[/color]

        Comment

        Working...