Atol - Crestron SIMPL+ Reference Manual

Language reference guide
Hide thumbs Also See for SIMPL+:
Table of Contents

Advertisement

Software
®
110
SIMPL+

Atol

Name:
Atol
Syntax:
LONG_INTEGER Atol(STRING SOURCE);
Description:
Converts a STRING to an LONG_INTEGER value. The conversion looks for the
first valid character (0-9), and then reads until it finds the first invalid character. The
resulting string of valid characters is then converted. The "-" is ignored, hence the
output is an unsigned number [i.e., ATOL("-1") would yield 1 as the output]. If no
valid value to convert is found, 0 is returned. If the integer exceeds 32 bits, the value
returned is undefined.
Parameters:
SOURCE is a string containing characters that range from 0 to 9 to be converted.
Return Value:
An integer representing the given string value. Example:
STRING_INPUT IN$[100];
LONG_INTEGER VAL;
CHANGE IN$
{
VAL = ATOL(IN$);
PRINT("Value of %s after ATOL is %ld\n", IN$, VAL);
}
For example, if IN$ is "abc1234xyz", then VAL will hold the number 1234. If IN$ is
"-50", then VAL will hold the number 50.
Version:
SIMPL+ Version 3.00.02
Control System
2-Series Only
Crestron SIMPL+
Language Reference Guide - DOC. 5797G
®

Advertisement

Table of Contents
loading

Table of Contents