SHIP:Sail:Functions

From Serious Documentation
Jump to: navigation, search

Numeric Functions

Function Returns Introduced Description
abs Integer/Float v4.0 Gets the absolute value of a number
argb Color v5.1.0 Creates a combined color from separate color channels.
atod Double v5.1.0 Parses a String to get a Double from it
atof Float v5.0.120 Parses a String to get an Float from it
atoi Integer v5.0.120 Parses a String to get an Integer from it
atol Long v5.1.0 Parses a String to get an Long from it
bytesToString String v5.0.207 Builds a string from the ASCII bytes of an Integer, Short, or Byte until a 0x00 byte is encountered or the number of bytes of the size of the object are consumed. Optionally, non-printable characters can be replaced as-encountered. All byte orderings are supported.
ceil Integer v5.0 Gets the smallest integer greater than or equal to a number
codepointToString String v4.0 Returns a single character string for the specified Unicode-16 codepoint. If the Codepoint is invalid, the string is empty.
dtof Integer v5.1.0 Explicitly casts an Double to a Float
dtoi Integer v5.0 Casts a Double to an Integer
dtol Long v5.1.0 Casts a Double to a Long
exp Float v5.1.0 Return e to the given power
expm1 Float v5.1.0 Return e to the given power minus 1
floor Integer v5.0 Gets the largest integer less than or equal to a number
ftod Integer v5.1.0 Explicitly casts an Float to a Double
ftoi Integer v5.0 Casts a Float to an Integer
ftol Long v5.1.0 Casts a Float to a Long
indexOf Integer v4.0 Returns the index of the first found occurrence (if any) of a substring within another string, optionally starting at a specified offset. If the substring is not found, -1 is returned.
itod Double v5.1.0 Explicitly casts an Integer to a Double
itof Integer v5.0 Explicitly casts an Integer to a Float
itol Integer v5.0 Explicitly casts an Integer to a Long
lastIndexOf Integer v4.0 Returns the index of the last found occurrence (if any) of a substring within another string, optionally starting at a specified offset. If the substring is not found, -1 is returned.
length Integer v2.0 Returns the length in characters (not bytes) of a string.
log Float v5.1.0 Return the natural log of a number
log10 Float v5.1.0 Return the base 10 log of a number
log1p Float v5.1.0 Return the natural log of a number + 1
ltod Long v5.1.0 Explicitly casts a Long to a Double
ltof Long v5.1.0 Explicitly casts a Long to a Float
ltoi Integer v5.1.0 Explicitly casts a Long to an Integer
mapRange Integer v5.1.0 Maps a number from range A to range B.
mapSteinhartHart Float v5.0.131 Calculates the precise temperature of a thermister.
max Integer/Float v4.0 Gets the maximum value of two or more numbers
min Integer/Float v4.0 Gets the minimum value of two or more numbers
neg Integer/Float v5.1.0 Return the negative of the given number
pow Float v5.1.0 Calculates x to the power of y (x^y)
random Integer v5.1.0 Generate a pseudo random number
round Integer v5.0 Gets the nearest integer to a number
sqrt Float v5.1.0 Calculates the square root of a number (√n)
toDegrees Float v5.1.0 Convert radians to degrees
toRadians Float v5.1.0 Convert degrees to radians
toString String v2.0 Converts an Integer or Float to a string. Options include leading 0 padding, radix, and precision.
towards Float/Integer v5.0.207 Adjusts a number by a percentage in a range towards another number

Trigonometric Functions

Function Returns Introduced Description
acos Float v5.1.0 Returns the radians angle of a value that is in the range of -1 to +1
acosh Float v5.1.0 Calculates the arc hyperbolic cos of the given value
asin Float v5.0.204 Calculates the radians angle of a value that is in the range of -1 to +1
asinh Float v5.1.0 Returns the arc hyperbolic sin of the given value
atan Float v5.0.204 Calculates the radian angle of the specified value
atan2 Float v5.1.0 Calculates the radian angle of the specified x,y coordinates
atanh Float v5.1.0 Calculates the arc hyperbolic tan of the given value
cos Float v5.0.204 Calculates the cos of a radian angle
cosh Float v5.1.0 Calculates the hyperbolic cos of the given value
sin Float v5.0.204 Calculates the sin of a radian angle
sinh Float v5.1.0 Calculates the hyperbolic sin of the given value
tan Float v5.1.0 Calculates the tan of a radian angle
tanh Float v5.1.0 Calculates the hyperbolic tan of the given value

String Functions

Function Returns Introduced Description
atod Double v5.1.0 Parses a String to get a Double from it
atof Float v5.0.120 Parses a String to get an Float from it
atoi Integer v5.0.120 Parses a String to get an Integer from it
atol Long v5.1.0 Parses a String to get an Long from it
bytesToString String v5.0.207 Builds a string from the ASCII bytes of an Integer, Short, or Byte until a 0x00 byte is encountered or the number of bytes of the size of the object are consumed. Optionally, non-printable characters can be replaced as-encountered. All byte orderings are supported.
charAt String v4.0 Returns the single character string extracted from a specified index in another string. This is a simplified version of subStr and provided for completeness in the API.
codepointAt Integer v4.0 Returns the Unicode-16 codepoint (or ASCII numeric value for characters in the ASCII range) of a character at a specified index in a String.
codepointToString String v4.0 Returns a single character string for the specified Unicode-16 codepoint. If the Codepoint is invalid, the string is empty.
indexOf Integer v4.0 Returns the index of the first found occurrence (if any) of a substring within another string, optionally starting at a specified offset. If the substring is not found, -1 is returned.
lastIndexOf Integer v4.0 Returns the index of the last found occurrence (if any) of a substring within another string, optionally starting at a specified offset. If the substring is not found, -1 is returned.
length Integer v2.0 Returns the length in characters (not bytes) of a string.
search Boolean v5.1.0 Implementation not complete.
subStr String v2.0 Returns the N-character substring of a string starting at an index.
subString String v2.0 Returns the substring of a string starting at an index and (optionally) ending before an index.
toLowerCase String v2.0 Replaces any ASCII upper case letters with lower case equivalents in a string.
toUpperCase String v2.0 Replaces any ASCII lower case letters with upper case equivalents in a string.
toString String v2.0 Converts an Integer or Float to a string. Options include leading 0 padding, radix, and precision.

Buffer Functions

Function Returns Introduced Description
bufClr Integer v5.1.0 Clears data in a buffer
bufCmp Boolean v5.1.0 Compares Buffer values.
bufCpy Integer v5.1.0 Copies from one buffer to another.
bufGet Integer v5.1.0 Retrieves data from a buffer.
bufPut Integer v5.1.0 Stores data into a buffer.
bufReset v5.1.0 Resets a buffer.
bufSet Integer v5.1.0 Initialize a buffer with a data pattern.

Node Functions

Function Returns Introduced Description
getChild Node v4.0 Gets a child Node object from within an enclosing parent Node, by index.
getChildIndex Integer v4.0.211 Gets the index of a Node within its enclosing parent Node.
getChildCount String v4.0 Gets a count of the total number of child Nodes within an enclosing parent Node.
set v5.1.0 Set a property value of a Node and its peers

Canvas Functions

Function Returns Introduced Description
draw v5.0 Causes run-time drawing in a canvas
image Integer v5.1.2 Display an image
qr Integer v5.1 Generates a QR code image in a canvas object.

Control Functions

Function Returns Introduced Description
reboot v5.1.0 Reboot SIM

See Also: