Jinx Core Library
The Jinx core library contains a number of functions that are generally useful, such as outputting debug text and manipulating collections. To use the core library in a Jinx script, you must add the following text to the beginning of your script:
import core
-- other script code follows...
The write function sends text to the registered debug out function. It will attempt to convert any parameter type to a string, and will iterate over the values of a collection, sending each value to the debug out function in turn.
Operates similarly to the write function, but sends a newline character when finished.
Returns the count or size of param as an integer for supported types, otherwise returns null.
· Collection – Returns the number of elements.
· String – Returns the number of Unicode characters (not bytes).
· Buffer – Returns the number of bytes in the buffer.
Returns true or false for supported types, otherwise returns null.
· Collection – Returns true if empty, false if not.
· String – Returns true if empty, false if not.
· Buffer – Returns true if empty, false if not.
Returns collection element’s key for iterator param, and returns null for all other types or if element is not in collection.
Returns collection element’s value for iterator param, or the return value of a coroutine. Returns null for all other types or if element is not in collection.
Returns collection of strings indicating the current call stack. The first entry is always “root”.
Invokes a function param, and returns the function’s return value.
Invokes a function param, forwarding all params to the function, and returns the function’s return value.
Invokes an asynchronous function param, and returns a coroutine handle.
Invokes an asynchronous function param, forwarding all params to the function, and returns a coroutine handle.
Executes the coroutine param and returns true if finished.
Executes all coroutines and returns true if all are finished.
Executes all coroutines and returns true any is finished.
The public property newline is primarily intended for use as a parameter for the write or write line functions.