In this example , localValueN has "2"
Code: Select all
local localValueN
put "2" into localValueN
if localValueN = "2"
then
put "is 2" into anotherVar
else
if localValueN = "3"
then
put "is 3" into anotherVar
else
put "is 4"into anotherVar
end if
end if
answer anotherVar
Can anyone think of a leaner, smarter, or shorter way to write this logic?
Question 2:
Can we put more code into each line? maybe some break that LiveCode understands when code starts or ends??
like this
Code: Select all
local localValueN ; put "2" into localValueN ; if localValueN = "2" ; then; put "is 2" into anotherVar ; else ; if localValueN = "3" ; then ; put "is 3" into anotherVar ; else ; put "is 4"into anotherVar ; end if ;end if
answer anotherVar