We learn a new thing every day!
But, Tygurs last Code, I think, expands Select case Immeasurably!
Compare the desired result against applied functions of that which you were testing, instead of the other way around.
I think its VERY useful.
-Lou
Printable View
We learn a new thing every day!
But, Tygurs last Code, I think, expands Select case Immeasurably!
Compare the desired result against applied functions of that which you were testing, instead of the other way around.
I think its VERY useful.
-Lou
Agreed, it is spot on. I just found the partial matching ability of the select case interesting and worthwhile adding to the discussion.Quote:
Originally posted by NotLKH
We learn a new thing every day!
But, Tygurs last Code, I think, expands Select case Immeasurably!
Compare the desired result against applied functions of that which you were testing, instead of the other way around.
I think its VERY useful.
-Lou
No OBJECTION!
It seems that Select case might not be as documented as it should be.
AND...
I just did an F1 on select, and in "See Also", there was "Choose".
Have you ever heard of the Choose Function?
If so, Besides what the Help says, What is it Good For?
Just so you know, I apparantly tend to question the established stuff,
try to figure out better, New, ways of using them, than posting questions about, ohh, SQL, or winsock, etc...
Those are amply{?} asked about here. Just Search.
But the Simple Stuff, How they tick, THAT could lead to something intersting!
But again, to reiterate,
I just did an F1 on select, and in "See Also", there was "Choose".
Have you ever heard of the Choose Function?
If so, Besides what the Help says, What is it Good For?
-Lou
Glad u like it. I've used the select case statement like that many times in the past, but I haven't seen anyone else do it in their code. For example, I've used it to check a set of boolean variables one by one until one of them turns out to be true. Most people just use it to test one variable for several different possible values it can have.Quote:
Originally posted by Nucleus
Agreed, it is spot on. I just found the partial matching ability of the select case interesting and worthwhile adding to the discussion.Quote:
Originally posted by NotLKH
We learn a new thing every day!
But, Tygurs last Code, I think, expands Select case Immeasurably!
Compare the desired result against applied functions of that which you were testing, instead of the other way around.
I think its VERY useful.
-Lou
Good idea, and I think the select case statement allows short circuiting, so it would be faster than a if boo1 = true or boo2 = true etc. If you tried to shortcircuit it with nested ifs, it would look terrible for anything more than about 3 booleans. So that is an elegant solution too.Quote:
Originally posted by Tygur
For example, I've used it to check a set of boolean variables one by one until one of them turns out to be true. Most people just use it to test one variable for several different possible values it can have.