The object contains all the system utilities.
| Availability | Global object, available in all scripts |
| Pre-initialized in | All scripts |
convap
| Description | Doubles the single quotes in the string, so that it can be used within an SQL statement |
| Value Type | string |
| Format | string = utility.convap(value) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| value | string | The value to be checked |
Examples
datatable = database.getsql("SELECT * FROM customers where name='" .. utility.convap("D'Amico") .. "'")
createdate
| Description | Creates a date in timestamp format |
| Value Type | double |
| Format | double = utility.createdate(year, month, day, hour, minute, second) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| year | integer | The year of the date to convert |
| month | integer | The month of the date to convert |
| day | integer | The day of the date to convert |
| hour | integer | The hour of the date to convert |
| minute | integer | The minutes of the date to convert |
| second | integer | The seconds of the date to convert |
Examples
date = utility.createdate(2024,03,16,2,30,0)
crlf
| Description | Returns the carriage return character |
| Value Type | string |
| Format | string = utility.crlf() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
Examples
carrier = utility.crlf()
dateadddays
| Description | Increases the days of a date |
| Value Type | double |
| Format | double = utility.dateadddays(timestamp, number) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| timestamp | double | The date to be modified in timestamp format |
| number | double | The number of days to add or subtract |
Examples
newdate = utility.dateadddays(date,1)
dateaddhours
| Description | Increases the hours of a given date |
| Value Type | double |
| Format | double = utility.dateaddhours(timestamp, number) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| timestamp | double | The date to be modified in timestamp format |
| number | double | The number of hours to add or subtract |
Examples
newdate = utility.dateaddhours(date,1)
dateaddminutes
| Description | Increases the minutes of a given date |
| Value Type | double |
| Format | double = utility.dateaddminutes(timestamp, number) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| timestamp | double | The date to be modified in timestamp format |
| number | double | The number of minutes to add or subtract |
Examples
newdate = utility.dateaddminutes(date,1)
dateaddmonths
| Description | Increases the months of a date |
| Value Type | double |
| Format | double = utility.dateaddmonths(timestamp, number) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| timestamp | double | The date to be modified in timestamp format |
| number | double | The number of months to add or subtract |
Examples
newdate = utility.dateaddmonths(date,1)
dateaddseconds
| Description | Increases the seconds of a date |
| Value Type | double |
| Format | double = utility.dateaddseconds(timestamp, number) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| timestamp | double | The date to be modified in timestamp format |
| number | double | The number of seconds to add or subtract |
Examples
newdate = utility.dateaddseconds(date,1)
dateaddyears
| Description | Increases the years of a date |
| Value Type | double |
| Format | double = utility.dateaddyears(timestamp, number) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| timestamp | double | The date to be modified in timestamp format |
| number | double | The number of years to add or subtract |
Examples
newdate = utility.dateaddyears(date,1)
dateday
| Description | Extracts the numerical value of the day from a date |
| Value Type | integer |
| Format | integer = utility.dateday(timestamp) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| timestamp | double | The timestamp date from where to extract the value |
datedayofweek
| Description | Returns a number representing the day of the week |
| Value Type | integer |
| Format | integer = utility.datedayofweek(timestamp) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| timestamp | double | The date in timestamp format |
datediffminutes
| Description | The function calculates the difference in minutes between two timestamp dates |
| Value Type | single |
| Format | single = utility.datediffminutes(startdate, enddate) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| startdate | double | The start timestamp date |
| enddate | double | The end timestamp date |
datehour
| Description | Extracts the numerical value of the hour from a date |
| Value Type | integer |
| Format | integer = utility.datehour(timestamp) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| timestamp | double | The timestamp date from where to extract the value |
dateminute
| Description | Extracts the numerical value of the minutes from a date |
| Value Type | integer |
| Format | integer = utility.dateminute(timestamp) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| timestamp | double | The timestamp date from where to extract the value |
datemonth
| Description | Extracts the numeric value of the month from a date |
| Value Type | integer |
| Format | integer = utility.datemonth(timestamp) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| timestamp | double | The timestamp date from where to extract the value |
datesecond
| Description | Extracts the numerical value of seconds from a date |
| Value Type | integer |
| Format | integer = utility.datesecond(timestamp) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| timestamp | double | The timestamp date from where to extract the value |
datetostring
| Description | Converts a timestamp date into a string |
| Value Type | string |
| Format | string = utility.datetostring(timestamp) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| timestamp | double | The date in timestamp format to be converted into a string |
dateyear
| Description | Extracts the numeric value of the year from a date |
| Value Type | integer |
| Format | integer = utility.dateyear(timestamp) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| timestamp | double | The timestamp date from where to extract the value |
escapehtml
| Description | Performs an HTML escape on a string |
| Value Type | string |
| Format | string = utility.escapehtml(value) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| value | string | The value to be converted |
formatdate
| Description | Converts a timestamp date into a defined string format |
| Value Type | string |
| Format | string = utility.formatdate(timestamp, format) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| timestamp | double | The date in timestamp format to be converted |
| format | string | The mask of the format to be applied to the string |
formatnum
| Description | Converts a numerical value into a string by rounding it to a specific number of decimals |
| Value Type | string |
| Format | string = utility.formatnum(number, numberdecimal) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| number | double | The number to be converted |
| numberdecimal | integer | The number of decimals to keep |
getnow
| Description | Retrieves the current date |
| Value Type | double |
| Format | double = utility.getnow() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
gguid
| Description | Returns a new unique identifier |
| Value Type | string |
| Format | string = utility.gguid() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
isnum
| Description | Checks whether a value is a number |
| Value Type | boolean |
| Format | boolean = utility.isnum(value) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| value | object | The value to be checked |
stringreplace
| Description | Replaces a part of a string with another value |
| Value Type | string |
| Format | string = utility.stringreplace(expression, find, replacement) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| expression | string | The string to be evaluated |
| find | string | The string to search for |
| replacement | string | The string that will replace the value found within the expression |
stringtrim
| Description | The function removes spaces on the right and left of a string |
| Value Type | string |
| Format | string = utility.stringtrim(expressions) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| expressions | string | The string to be checked |
tid
| Description | Returns the current date in numeric format, to be used as a time marker on records |
| Value Type | double |
| Format | double = utility.tid() |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Notes | The date format used is “YYYYMMDDhhmmss” |
urlencode
| Description | Performs an escape on a URL link |
| Value Type | string |
| Format | string = utility.urlencode(value) |
| Type | Method |
| Systems | Windows, Web, Android, IOS, Mac OS |
| Parameter | Value Type | Description |
| value | string | The URL link to be converted |