Conversion functions
The last group of native functions is
used in Pico programs to perform conversions, that is,
starting from a given value of a certain type generating an
associated value of another type. These are the rules:
- the function
trunc
generates a number value corresponding with the truncation of the
number or fraction value of the argument
- the function
char
generates a text value containing the character representation
corresponding with the number value of the argument
- the function
ord
generates a number value corresponding with the ordinal of the
character held in the text value of the argument
- the function
number
will -if possible- generate a number or fraction value from the
text value of the argument; if not, the value of
void
is returned
- the function
abs
generates a numerical value corresponding with the absolute value
of the number or fraction value of the argument
- the function
text
generates a text value corresponding with the number, fraction or
text value of the argument
![](imgs/img00036.gif)
Note that typically a combination of
accept
and number
will be used to retrieve numerical values from a keyboard.