Macro Constants

From GiderosMobile
Revision as of 23:38, 15 August 2020 by MoKaLux (talk | contribs) (added example + formatting)

Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.png
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

num1 @ &2^0&
num2 @ &2^1&
num3 @ &num1 + num2&

pi@3.14159265358979324
num4 @ -100.54
num5 @ 232
num6 @ 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

Events

Constants