Replacing a switch
Date: Wed, 14 Jan 2004 23:01:33 +0000
I'm trying to re-write this piece of code. I've seen it done another way
which was much nicer (to my mind)
The code is
t = " pt";
t = " mm";
case 2 :
t = " pica";
Now, I'm trying to change this to be something like
t = ((" pt" && Einhaft == 0) || (" mm" && Einhaft == 1) ||
(" pica" && Einhaft == 2));
A quick test and this will compile, but t doesn't contain what I would
have thought it would contain.
Any ideas what I'm doing wrong?
- Re: switch statement - ANSI-C
... Keep in mind, the OP in question here was originally asking about how ... to do a switch on string arguments. ... Someone that unfamiliar with the ...
- Re: Change Text to Memo
... Switch a given table field to Memo ... Function SwitchFieldType(sDb As String, sTableName As String, sFieldName ... Dim sSQL As String ... If Err.Number = 0 Then Exit Function ...
- Re: proposal: reswitch
... > which levels of loops and/or switches and/or ... socket -server command ?-myaddr addr? ... You've got the quick-exit (break, no string), the fall-through to next ... -switch option), then it'd be the nth switch. ...
- Re: Large text file import: MVP question
... Simple solutions give fast processing ... One thing you have to keep in mind. ... througput time than from the basic Net namespace. ... change, with mid, split, tolower, or whatever will result in a new string. ...
- Re: String-based Switch Request...
... Facilitate good callback programming design and modularization within GUI code ... When ever switch statements are used, they are typically over used being favour over polymorphism, which leads to brittle shoddy design. ... Use the string type-code as the Key and a Command or Strategy Object as the Value. ...