Skip to content

Utilities

The utilities library provides number and text utilities for all the different libraries.

Number

checkRange()
checks whether a value is in range, and returns the value or, if the value is outside the range, the lower or upper limit of the range. The function is available for signed and unsigned, 16-bit and 32-bit, integers.
setMinMax()
updates the minimum and maximum with the value.

Text

utf8to16()
converts a text coded in UTF-8 into a string coded in UTF-16, and returns the number of UTF-16 characters.
formatString()
returns an array of characters or a string from a text and a format specifier. The format uses the standard printf() specifier characters .

Legacy release 9

utf2iso()
converts a text coded in UTF-8 into a string coded in ISO-8859-1 or Latin 1.

This function is deprecated and not longer required as gText() now accepts text coded UTF-8 directly.

Miscellaneous

GridXY
The GridXY object calculates the relative coordinates and sizes to ease the design of a page.
The technical note Use the GridXY object lists the methods and provides an example. The technical note explains how to Design a page.