TYL PROGRAMMING LANGUAGE
▶ SYSTEM FUNCTIONS REFERENCE
beep frequency duration
Causes the system to play its internal beep sound.
frequency
frequency in Hz, range: { 37, 32767 }, default: 440 (optional)
duration
duration in milliseconds, default: 400 (optional)
clear
Clears the run box screen.
exit num
Terminates the program. If num exists, exits with exit code num, otherwise exits with default exit code.
num
numeric variable
in index
Gets program input arguments. If index is omitted returns a record of all input variables, where the keys are the indices, otherwise returns the argument at index position.
index
scalar variable (optional)
input var
Waits for the user to enter text, and assigns the text to var. If var omitted, ignores the input text.
var
scalar variable (optional)
keyof var → name
Returns variable name. For ex., if we declared num variable, keyof returns 'num'.
var
Tyl variable
name
name of var.
len var → length
var
Tyl variable
length
for string, returns string length, for list - the number of items in the list, and for record - the number of keys in the record mapping data.
not var → result
Each Tyl variable has a boolean representation, and not system function returns the boolean not of it. For ex., if var is string variable, and it is null or empty, result will be TRUE.
var
Tyl variable
result
boolean variable
now → time
Returns a record of the current time informaion with the following data:
  • yeargregorian year
  • monthmonth of year
  • dayday of month
  • hourhours
  • minuteminutes
  • secondseconds
  • millisecondmilliseconds
  • totalsecondtotal seconds from last day
  • weekdayday of week
  • yeardayday of year
  • fulldatefull date string
null var → result
For scalars returns TRUE if scalar is not defined or if its value is NULL. For function parameters returns TRUE if the parameter is NULL. For record keys returns TRUE if the key does not exist.
var
Tyl variable
result
boolean variable
out var
Causes the system to write var to output stream.
var
Tyl variable
pause duration
Causes the system to pause program execution for duration seconds. All operating system activities and asynchronous processes will continue to be executed.
duration
real number
print var → result
Prints the string representation of var, and returns var.
var
Tyl variable
result
var
random
Returns a real number in the range { 0, 1 }
unicode value → symbol
If value is a valid hexadecimal string or a number, and is in UNICODE hexadecimal range, returns UNICODE symbol.
value
an hexadecimal string or its numeric value
symbol
UNICODE symbol