PDA

View Full Version : Constants & Numbers.


jassing
10-29-2008, 07:02 AM
I had this in my screen, added via a text editor:


Screen.StartTimer(#IMPORTANTSCREENDELAY#);

The constant is defined as 3000

The screen timer works as expected.

however if I try to edit that same code in SUF, it complains about the constant...

Why would it complain, but work?

Darryl
10-30-2008, 01:40 PM
Hey Josh,

I believe the issue you are encountering can be explained by the following note in the Constants section of the help file:

Note: Design-time constants can be in any format you like. One recognizable format is the variable name in capitals surround by "#" characters. For example, #MYVAR#. However if you plan to use these design-time constants in action script, the names may be caught by the automatic syntax checker if certain characters are used that are part of the Lua language (such as "#"). In this case, it is best to use an alternate format such as _MYVAR.

If what you're experiencing is not what has been described there, please let us know.

jassing
10-30-2008, 03:06 PM
Thanks Daryl -- that's probably it -- I missed that note; and once reminded -- I recall that from previous suf versions as a work around -- indeed, in another project there's a comment "Can't use standard # syntax for numbers"... so I had a senior moment....