LUA script: possible bug

Started by bertro

bertro Lv 1

The attached script, when run, works ok.

But if any of the commented lines are un-commented then it return an ERROR during compilation.

Anyone can explain what is happening?

Thanks

rmoretti Staff Lv 1

Not 100% up to speed on Lua, so I might be missing some advanced detail, but from what I understand, Lua identifiers can be any string of letters, digits, and underscores – so long as they don't start with a digit.

In the commented out lines you're starting the instance variable with the digit '1' (one), versus the other lines, where you're using the letter "l" (lower-case L).

bertro Lv 1

if you have a 2nd look, lines 20 to 23 and 44 to 47 are in the same situation but do not trigger the problem. Why?

robgee Lv 1

Its the font.
lines 20 to 23 and 44 to 47 actually do start with an 'l', ie lowercase 'L'.

ask.ll3a = dialog.AddLabel("myString") –no error {lowercase L}
ask.113a = dialog.AddLabel("myString") – error {digit}