? How Can I Use #Tags? (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

How Can I Use #Tags?

  • #1 ✎ 8 Stefano_Lassandro Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Drawing I like to draw! Hobbies Minecraft Is Awesome! I love Minecraft! Express Yourself Anyone can explain me how to use tags for assigning a code string to an #? Thanks! Posted
  • #2 ✎ 1055 snail_ QSP Contest 1 Contest Participant I participated in the first SmileBASIC Source QSP Contest! Helper Received for being very helpful around SmileBASIC Source Achievements Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Are you referring to defining constants? Not available in the 3DS version. Posted
  • #3 ✎ 8 Stefano_Lassandro Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Drawing I like to draw! Hobbies Minecraft Is Awesome! I love Minecraft! Express Yourself Ok thanks! Posted
  • #4 ✎ 404 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website 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. Posted Edited by HTV04
  • #5 ✎ 8 Stefano_Lassandro Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Drawing I like to draw! Hobbies Minecraft Is Awesome! I love Minecraft! Express Yourself
    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!!
    Posted
  • #6 ✎ 8 Stefano_Lassandro Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Drawing I like to draw! Hobbies Minecraft Is Awesome! I love Minecraft! Express Yourself RESETZ$="A=0" #RESETZERO=RESETZ$ And then #RESETZERO Will this thing work? Posted
  • #7 ✎ 1055 snail_ QSP Contest 1 Contest Participant I participated in the first SmileBASIC Source QSP Contest! Helper Received for being very helpful around SmileBASIC Source Achievements Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements 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 Posted