Access to stdlib functiuons. More...
| int stdlib::abs(int i) |
| int stdlib::rand() |
| int stdlib::time() |
| int stdlib::secSinceMacroStart() |
| int stdlib::msecSinceMacroStart() |
stdLib is a static hub for a few C stdlib helpers in LayoutEditor C++ macros. There is no object to construct: call stdlib::abs, stdlib::rand, or the time members with the class name. abs is the integer absolute value; rand is a platform-dependent random integer. time, secSinceMacroStart, and msecSinceMacroStart measure seconds or milliseconds for timing a macro. Other scripting languages already have native abs, random, and clocks, so this class is not exposed there. Use math for floating-point functions such as sin and sqrt.
Example:
int a = stdlib::abs(-12);
int t0 = stdlib::msecSinceMacroStart();
int r = stdlib::rand();
int dt = stdlib::msecSinceMacroStart() - t0;
Returns: the absolute (positive) value of i.
Returns: a random integer. The maximum range depends on the platform.
Returns: an integer with the number of seconds (since this method was added). (introduced with release 20241011)
Returns: the number of seconds since the macro was started. (introduced with release 20241011)
Returns: the number of milliseconds since the macro was started. (introduced with release 20241011)