Skip to main content

Gotchas

ThisDoesBecause
"Total: " + n0+ only concatenates two Texts. Use StringFormat.
StringFormat("{0}", n)compile errorit always takes 3 arguments. Add , "".
UtilityPrint(n)stops the actionits parameter is Text. Use UtilityPrint(StringFormat("{0}", n, "")).
"C:\temp"C:, a tab, then emp\t is an escape. Write "C:\\temp".
flags & 4 == 40& binds looser than ==. Write (flags & 4) == 4.
0 < x < 10falseit compares a Bool with an Integer. Write x > 0 && x < 10.
ok && Risky()runs Risky() anywayno short-circuit evaluation
true == 1, w == 0falsedifferent kinds are never equal. Test a handle with !w.
7 / 23Integer division. Write 7 / 2.0.
StringFormat("{0}", 0.5, "")0.500000Reals always show six decimals
two StringSplits in a loopwrong partsthe second split replaces the first one's cache
"apple" < "Banana"falseordinal comparison puts all uppercase before lowercase
a variable set only inside an if0 when the branch didn't runvariables that were never assigned at run time start as Integer 0