Difference between revisions of "Macro Constants"
From GiderosMobile
Line 3: | Line 3: | ||
'''Available since:''' Gideros 2017.10<br/> | '''Available since:''' Gideros 2017.10<br/> | ||
=== Description === | === Description === | ||
− | <br /> | + | <translate><br /> |
Macro Constants can be used for string and numeric constants.<br /><br /> | Macro Constants can be used for string and numeric constants.<br /><br /> | ||
Line 9: | Line 9: | ||
You can use any of these delimiters after @ but they must be used in pairs. Numbers are auto-detected.<br /> | You can use any of these delimiters after @ but they must be used in pairs. Numbers are auto-detected.<br /> | ||
− | \`~ ! # $ % ^ & * / + = |<br /> | + | \`~ ! # $ % ^ & * / + = |<br /></translate> |
=== Examples === | === Examples === | ||
'''Simple examples'''<br/> | '''Simple examples'''<br/> | ||
− | <source lang="lua" | + | <source lang="lua"> |
pi@3.14159265358979324 | pi@3.14159265358979324 | ||
num1 @ -100.54 | num1 @ -100.54 | ||
Line 24: | Line 24: | ||
]]</source> | ]]</source> | ||
'''Commenting out the print command'''<br/> | '''Commenting out the print command'''<br/> | ||
− | <source lang="lua" | + | <source lang="lua"> |
print @ |--| | print @ |--| | ||
Revision as of 13:34, 23 August 2018
Supported platforms: android, ios, mac, pc
Available since: Gideros 2017.10
Description
Macro Constants can be used for string and numeric constants.
Just use @ rather than = when defining the macro.
You can use any of these delimiters after @ but they must be used in pairs. Numbers are auto-detected.
\`~ ! # $ % ^ & * / + = |
Examples
Simple examples
pi@3.14159265358979324
num1 @ -100.54
num2 @ 232
num3 @ 444.10
str1 @ 'hello'
str2 @ "world"
str3 @ [[
Hello,
world!
]]
Commenting out the print command
print @ |--|
print(x, y, z, x + y, y * z) -- this line will be skipped
Methods |
EventsConstants |