How Can I Use #Tags?

Root / General / [.]

Stefano_LassandroCreated:
Anyone can explain me how to use tags for assigning a code string to an #? Thanks!

Are you referring to defining constants? Not available in the 3DS version.

Ok thanks!

Constants still exist in SB3 though, they just can’t be defined. For the constants that are in SB3, use them as numbers. For example:
IF BUTTON(0) AND #A THEN
'Is the same as
IF BUTTON(0) AND 16 THEN
.

Constants still exist in SB3 though, they just can’t be defined. For the constants the are in SB3, use them as numbers. For example:
IF BUTTON(0) AND #A THEN
'Is the same as
IF BUTTON(0) AND 16 THEN
.
Thanks!!

RESETZ$="A=0"
#RESETZERO=RESETZ$
And then
#RESETZERO
Will this thing work?

No, not really. This will work in SB4 if you add a CONST keyword to the constant declaration, but you can't declare your own constants at all in SB3.
CONST #RESETZERO="A=0"
Note that a CONST can only be assigned a constant expression/value (not a variable or result of a function) and can only be assigned once. This is because they're compile-time constants that are intended just for giving fixed values special names. It looks like you want to associate code with a constant name though. A constant is only a value evaluated at compile so you can't do that. Use a DEF instead.
DEF RESETZERO
 A=0
END

RESETZERO 'use as a statement