Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
switch
#1
Is there a switch command in NaaLaa? I did not found it in the old docs of NaaLaa 5.

Is it possible to allow this type of programming in NaaLaa

i, b, c vars in line with just  one separator

what about this one?
i = b = c = 0
Reply
#2
(02-08-2018, 03:22 PM)cvirus Wrote: Is there a switch command in NaaLaa? I did not found it in the old docs of NaaLaa 5.

Is it possible to allow this type of programming in NaaLaa

i, b, c vars in line with just  one separator

what about this one?
i = b = c = 0

Nope, there's no switch command. I could probably add it quickly just as an alternative to if/elseif/else, but implementing it with "jump tables" would be the best.

Not sure about 'a, b, c'. I think it was possible in some version. If not, 'a; b; c' does the same thing: sets a, b an c to 0. Just writing the name of a variable, of any type, as a statement, sets its value to 0/0.0/"" (or clears an array or object).

'a = b = c = 42' gives an error, I never use that in any language Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)