Macros
From Sputnik Wiki
(Difference between revisions)
(→Misc) |
|||
Line 1: | Line 1: | ||
= Macros = | = Macros = | ||
− | === | + | === For Functions === |
− | @ | + | @ARGS // Stores all arguments passed to a function allowing for unlimited arguments. |
− | + | === Strings === | |
− | + | <syntaxhighlight lang="sputnik"> | |
+ | @CRLF // @CR . @LF ;Occasionally used for line breaks. | ||
+ | @LFCR // @LF . @CR ;Stupidly used for line breaks. | ||
+ | @CR // Carriage return, Chr(13); sometimes used for line breaks. | ||
+ | @LF // Line feed, Chr(10); typically used for line breaks. | ||
+ | @TAB // Tab character, Chr(9). | ||
+ | </syntaxhighlight> | ||
=== Math === | === Math === | ||
− | @PI | + | <syntaxhighlight lang="sputnik"> |
+ | @PI // Mathematical constant that is the ratio of any circle's circumference to its diameter | ||
+ | @E // Represents the natural logarithmic base, specified by the constant, e. | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | === Variable Limits etc === | ||
+ | |||
+ | <syntaxhighlight lang="sputnik"> | ||
+ | @CHAR_MIN // Represents the smallest possible value of a unicode character | ||
+ | @CHAR_MAX // Represents the largest possible value of a unicode character | ||
+ | @BYTE_MIN // Represents the smallest possible value of a unsigned 8-bit integer | ||
+ | @BYTE_MAX // Represents the largest possible value of a unsigned 8-bit integer | ||
+ | @SBYTE_MIN // Represents the smallest possible value of a signed 8-bit integer | ||
+ | @SBYTE_MAX // Represents the largest possible value of a signed 8-bit integer | ||
+ | @USHORT_MIN // Represents the smallest possible value of a unsigned 16-bit integer | ||
+ | @USHORT_MAX // Represents the largest possible value of a unsigned 16-bit integer | ||
+ | @UINT16_MIN // Represents the smallest possible value of a unsigned 16-bit integer | ||
+ | @UINT16_MAX // Represents the largest possible value of a unsigned 16-bit integer | ||
+ | @UINT_MIN // Represents the smallest possible value of a unsigned 32-bit integer | ||
+ | @UINT_MAX // Represents the largest possible value of a unsigned 32-bit integer | ||
+ | @UINT32_MIN // Represents the smallest possible value of a unsigned 32-bit integer | ||
+ | @UINT32_MAX // Represents the largest possible value of a unsigned 32-bit integer | ||
+ | @ULONG_MIN // Represents the smallest possible value of a unsigned 64-bit integer | ||
+ | @ULONG_MAX // Represents the largest possible value of a unsigned 64-bit integer | ||
+ | @UINT64_MIN // Represents the smallest possible value of a unsigned 64-bit integer | ||
+ | @UINT64_MAX // Represents the largest possible value of a unsigned 64-bit integer | ||
+ | @SHORT_MIN // Represents the smallest possible value of a signed 16-bit integer | ||
+ | @SHORT_MAX // Represents the largest possible value of a signed 16-bit integer | ||
+ | @INT16_MIN // Represents the smallest possible value of a signed 16-bit integer | ||
+ | @INT16_MAX // Represents the largest possible value of a signed 16-bit integer | ||
+ | @INT_MIN // Represents the smallest possible value of a signed 32-bit integer | ||
+ | @INT_MAX // Represents the largest possible value of a signed 32-bit integer | ||
+ | @INT32_MIN // Represents the smallest possible value of a signed 32-bit integer | ||
+ | @INT32_MAX // Represents the largest possible value of a signed 32-bit integer | ||
+ | @LONG_MIN // Represents the smallest possible value of a signed 64-bit integer | ||
+ | @LONG_MAX // Represents the largest possible value of a signed 64-bit integer | ||
+ | @INT64_MIN // Represents the smallest possible value of a signed 64-bit integer | ||
+ | @INT64_MAX // Represents the largest possible value of a signed 64-bit integer | ||
+ | @DOUBLE_POSINF // Represents positive infinity | ||
+ | @DOUBLE_NEGINF // Represents negative infinity | ||
+ | @DOUBLE_NAN // Represents (Not a number) NaN | ||
+ | @DOUBLE_MIN // Represents the smallest possible value of a float | ||
+ | @DOUBLE_MAX // Represents the largest possible value of a float | ||
+ | @DOUBLE_EPSILON // Represents the smallest positive double value greater than zero | ||
+ | @FLOAT_POSINF // Represents positive infinity | ||
+ | @FLOAT_NEGINF // Represents negative infinity | ||
+ | @FLOAT_NAN // Represents (Not a number) NaN | ||
+ | @FLOAT_MIN // Represents the smallest possible value of a float | ||
+ | @FLOAT_MAX // Represents the largest possible value of a float | ||
+ | @FLOAT_EPSILON // Represents the smallest positive float value greater than zero | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | === & and Time === | ||
+ | |||
+ | <syntaxhighlight lang="sputnik"> | ||
+ | @DATETIMENOW // Stores the current date and time. | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | === Misc === | ||
− | @ | + | <syntaxhighlight lang="sputnik"> |
+ | @ERROR // Stores the state of the last error which can be useful to find out exactly what happened. | ||
+ | @CURRENCY // Stores the local currency symbol that the computer is using such as $ or £ etc. | ||
+ | @GROUP // Stores the amount of groups captured in the last regex match operation. | ||
+ | </syntaxhighlight> | ||
[[Category:Core Function]] | [[Category:Core Function]] |
Revision as of 00:23, 21 November 2011
Contents |
Macros
For Functions
@ARGS // Stores all arguments passed to a function allowing for unlimited arguments.
Strings
@CRLF // @CR . @LF ;Occasionally used for line breaks. @LFCR // @LF . @CR ;Stupidly used for line breaks. @CR // Carriage return, Chr(13); sometimes used for line breaks. @LF // Line feed, Chr(10); typically used for line breaks. @TAB // Tab character, Chr(9).
Math
@PI // Mathematical constant that is the ratio of any circle's circumference to its diameter @E // Represents the natural logarithmic base, specified by the constant, e.
Variable Limits etc
@CHAR_MIN // Represents the smallest possible value of a unicode character @CHAR_MAX // Represents the largest possible value of a unicode character @BYTE_MIN // Represents the smallest possible value of a unsigned 8-bit integer @BYTE_MAX // Represents the largest possible value of a unsigned 8-bit integer @SBYTE_MIN // Represents the smallest possible value of a signed 8-bit integer @SBYTE_MAX // Represents the largest possible value of a signed 8-bit integer @USHORT_MIN // Represents the smallest possible value of a unsigned 16-bit integer @USHORT_MAX // Represents the largest possible value of a unsigned 16-bit integer @UINT16_MIN // Represents the smallest possible value of a unsigned 16-bit integer @UINT16_MAX // Represents the largest possible value of a unsigned 16-bit integer @UINT_MIN // Represents the smallest possible value of a unsigned 32-bit integer @UINT_MAX // Represents the largest possible value of a unsigned 32-bit integer @UINT32_MIN // Represents the smallest possible value of a unsigned 32-bit integer @UINT32_MAX // Represents the largest possible value of a unsigned 32-bit integer @ULONG_MIN // Represents the smallest possible value of a unsigned 64-bit integer @ULONG_MAX // Represents the largest possible value of a unsigned 64-bit integer @UINT64_MIN // Represents the smallest possible value of a unsigned 64-bit integer @UINT64_MAX // Represents the largest possible value of a unsigned 64-bit integer @SHORT_MIN // Represents the smallest possible value of a signed 16-bit integer @SHORT_MAX // Represents the largest possible value of a signed 16-bit integer @INT16_MIN // Represents the smallest possible value of a signed 16-bit integer @INT16_MAX // Represents the largest possible value of a signed 16-bit integer @INT_MIN // Represents the smallest possible value of a signed 32-bit integer @INT_MAX // Represents the largest possible value of a signed 32-bit integer @INT32_MIN // Represents the smallest possible value of a signed 32-bit integer @INT32_MAX // Represents the largest possible value of a signed 32-bit integer @LONG_MIN // Represents the smallest possible value of a signed 64-bit integer @LONG_MAX // Represents the largest possible value of a signed 64-bit integer @INT64_MIN // Represents the smallest possible value of a signed 64-bit integer @INT64_MAX // Represents the largest possible value of a signed 64-bit integer @DOUBLE_POSINF // Represents positive infinity @DOUBLE_NEGINF // Represents negative infinity @DOUBLE_NAN // Represents (Not a number) NaN @DOUBLE_MIN // Represents the smallest possible value of a float @DOUBLE_MAX // Represents the largest possible value of a float @DOUBLE_EPSILON // Represents the smallest positive double value greater than zero @FLOAT_POSINF // Represents positive infinity @FLOAT_NEGINF // Represents negative infinity @FLOAT_NAN // Represents (Not a number) NaN @FLOAT_MIN // Represents the smallest possible value of a float @FLOAT_MAX // Represents the largest possible value of a float @FLOAT_EPSILON // Represents the smallest positive float value greater than zero
& and Time
@DATETIMENOW // Stores the current date and time.
Misc
@ERROR // Stores the state of the last error which can be useful to find out exactly what happened. @CURRENCY // Stores the local currency symbol that the computer is using such as $ or £ etc. @GROUP // Stores the amount of groups captured in the last regex match operation.