Mark, et al:
I believe that form of the switch statement with no argument may be
unique to Transcript. I do use it to handle all sorts of corner conditions
that would otherwise result in really ugly code, but I have to twist my head
around it each time,
That form of switch introduces the
Much clearer - thanks everyone - I think the documentation should be a
little clearer with this?
So I had a go - which proved pretty difficult - I don't envy anyone trying
to do technical documentation. Here is the best I can do for now. I added a
few examples and i think the hypertext links to d
Eric-
switch -- note there is nothing more here ;-)
...and I believe that form of the switch statement with no argument may be
unique to Transcript. I do use it to handle all sorts of corner conditions
that would otherwise result in really ugly code, but I have to twist my head
around it
Hi David,
I use the switch statement a lot - but only for basic "case" tests and
have not been able to get:
"If the caseValue is equal to the switchExpression, or the
caseCondition evaluates to true"
Don't forget that switch logic falls through from case to ca
Hi David,
If you specify a variable just after the switch statement, each case
value refers to this variable.
So, in your case, try:
switch -- note there is nothing more here ;-)
case mainChoice = "Go to script object"
break
case (mainChoice i
I use the switch statement a lot - but only for basic "case" tests and
have not been able to get:
"If the caseValue is equal to the switchExpression, or the
caseCondition evaluates to true"
working. Here is an example that I just changed from "if then else" -
wh
On Aug 4, 2004, at 3:28 PM, Bill wrote:
else
put "go visit Andre in South America" into fld "e6"
end if
Oh boy if there's a bug in this software I'll end with ballast or
illegal aliens in my home
:-)
Andre
--
Andre Alves Garzia 2004 BRAZIL
http://studio.soapdog.org
__
Thanks this worked. I thought you had to use a switch statement because an
if statement could only have one "else". Now I realize a switch/case
statement is only used because it is faster for comparing one item against
other items to match exactly. This is an example of how an old
If you are searching for your words in a larger string, then this won't
work with a case statement. Case statements are better (that is,
slightly faster - maybe) than if-then-else chains when you are comparing
a single variable with multiple constants. If you need to perform
processing (like a
switch (Text) contains
case "ballast"
put "no cargo" into fld "e4"
break
case "bulk"
put "oil bunkers" into fld "e5"
break
default
put "general cargo" into fld "e6"
end switch
The above is a simple switch where (Text) is more than one word and I am
looki
switch (Text) contains
case "ballast"
put "no cargo" into fld "e4"
break
case "bulk"
put "oil bunkers" into fld "e5"
break
default
put "general cargo" into fld "e6"
end switch
The above is a simple switch where (Text) is more than one word and I am
looki
switch (Text) contains
case "ballast"
put "no cargo" into fld "e4"
break
case "bulk"
put "oil bunkers" into fld "e5"
break
default
put "general cargo" into fld "e6"
end switch
The above is a simple switch where (Text) is more than one word and I am
look
12 matches
Mail list logo