need some suggestions

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

    #1

    need some suggestions

    I'm looking for a simple case type construct like IIF but that'll handle
    3 possibilities. I doubt this is possible but?????
  • Herfried K. Wagner [MVP]

    #2
    Re: need some suggestions

    "cj" <cj@nospam.nosp am> schrieb:[color=blue]
    > I'm looking for a simple case type construct like IIF but that'll handle
    > 3 possibilities. I doubt this is possible but?????[/color]

    Check out VB's 'Choose' and 'Switch' functions.

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>

    Comment

    • cj

      #3
      Re: need some suggestions

      Both suggestions are precisely what I was looking for and I remember
      them now. Switch will work best this time.

      I do wish instead of switch working like this:

      Switch(CityName = "London", "English", _
      CityName = "Rome", "Italian", CityName = "Paris", "French")

      It worked more like this:

      Switch(CityName =, "London", "English", _
      "Rome", "Italian", "Paris", "French")

      I find myself having to repeat myself over and over in VB lately. Maybe
      it's always been the case but It just seems that it's been more often
      since I got started with VB.net.

      Hummm, now that I wrote that I kinda wish the Select Case structure did
      allow me repeat myself. Cause I was just complaining the other day I
      couldn't say something like:

      Select Case
      Case state = "VA"
      messagebox.show ("I'm sorry VA residents are not eligible.")
      Case address1.substr ing(0, 6) = "PO BOX"
      messagebox.show ("PO boxes are not valid.")
      Case else
      Console.WriteLi ne("Congratulat ions! You could be a wiener!")
      End Select

      I guess there is just no pleasing me. :)

      Thanks again for the excellent suggestions!


      Herfried K. Wagner [MVP] wrote:[color=blue]
      > "cj" <cj@nospam.nosp am> schrieb:[color=green]
      >> I'm looking for a simple case type construct like IIF but that'll
      >> handle 3 possibilities. I doubt this is possible but?????[/color]
      >
      > Check out VB's 'Choose' and 'Switch' functions.
      >[/color]

      Comment

      Working...