|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
need some suggestionsI'm looking for a simple case type construct like IIF but that'll handle
3 possibilities. I doubt this is possible but????? "cj" <cj@nospam.nospam> schrieb: Check out VB's 'Choose' and 'Switch' functions.> I'm looking for a simple case type construct like IIF but that'll handle > 3 possibilities. I doubt this is possible but????? -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> 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.substring(0, 6) = "PO BOX" messagebox.show("PO boxes are not valid.") Case else Console.WriteLine("Congratulations! 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: Show quoteHide quote > "cj" <cj@nospam.nospam> schrieb: >> I'm looking for a simple case type construct like IIF but that'll >> handle 3 possibilities. I doubt this is possible but????? > > Check out VB's 'Choose' and 'Switch' functions. >
Books: (I'm converting vb release 4 to release 8) But will eventually move it to other PCs
simple OO question Red Semaphore. Ideas? Writing and reading from a template Excel file using ADO.Net - results not recalculated minimizing viewstate Managed DX - 'DrawText' ambiguous EVAL function sending values to a VB.Net exe Using a User's Control of VB.NET in a Form of VB6 <Flags()> ENUM attibute |
|||||||||||||||||||||||