Reserved Identifiers
102
NetLinx Programming Language Reference Guide
Keywords & Run-Time Library Functions (Cont.)
ATOI
Converts a character representation of a number to an signed 32-bit integer.
The syntax:
SLONG ATOI (CHAR STRING[ ])
Parameters:
•
STRING
- string containing the character representation of the integer.
Result:
• A 32-bit signed integer representing the converted string.
• Any non-numeric characters in the string are ignored.
• ATOI returns the value representing the first complete set of characters that
represents an integer.
• Valid characters are "0" through "9" and "-" (minus sign), if it occurs before the
number. If no valid characters are found, zero is returned as a result.
Example:
Num = ATOI('100') // Num = 100
Note
: While you can pass in larger values, ATOI will truncate any value outside
the range -2147483648 to 2147483647 to the value -2147483648 (if negative)
or 2147483647 (if positive).
ATOF
This function converts a character representation of a number to a 64-bit float-
ing-point value. It recognizes a character representation of a signed integer or
floating-point number (with or without exponent).
FLOAT ATOF (CHAR STRING[ ])
Parameters
:
•
STRING
: An input string containing the character representation of the
floating-point number.
The result is a 64-bit floating-point number representing the converted string.
Any non-numeric characters in the string are ignored.
ATOF
returns the value
representing the first complete set of characters that represents a floating-point
value. Valid characters are "0" through "9", ".", the sign designators ("+" and
"-"), and the exponent ("e" or "E"). If no valid characters are found, zero is
returned as a result.
Num = ATOF('The total = -1.25e-3')// Num = -0.00125
ATOL
This function converts a character representation of a number to a
signed
32-bit
integer.
SLONG ATOL (CHAR STRING[ ])
Parameters:
•
STRING
: A string containing the character representation of the integer.
The result is a 32-bit signed integer representing the converted string. Any non-
numeric characters in the string are ignored.
ATOL
returns the value represent-
ing the first complete set of characters that represents an integer. Valid charac-
ters are "0" through "9" and the sign designators "+" and "-". If no valid
characters are found, zero is returned as a result.
Num = ATOL('Value = -128000') // Num = -128000
BAND (&)
This operator performs a bitwise
AND
on two data items, which can be constants
or variables.
BNOT (~)
This operator performs a bitwise
NOT
on a constant or variable.
BOR (|)
This operator performs a bitwise
OR
on two data items, which can be constants
or variables.
Содержание NETLINX PROGRAMMING LANGUAGE
Страница 15: ...Table of Contents xiii NetLinx Programming Language Reference Guide...
Страница 16: ...xiv NetLinx Programming Language Reference Guide Table of Contents...
Страница 18: ...Introduction 2 NetLinx Programming Language Reference Guide...
Страница 76: ...Language Elements 60 NetLinx Programming Language Reference Guide...
Страница 106: ...Combining Devices Levels and Channels 90 NetLinx Programming Language Reference Guide...
Страница 112: ...Master To Master M2M 96 NetLinx Programming Language Reference Guide...
Страница 114: ...Mainline 98 NetLinx Programming Language Reference Guide FIG 1 Message and Mainline Processing in the NetLinx System...
Страница 182: ...Reserved Identifiers 166 NetLinx Programming Language Reference Guide...
Страница 204: ...NetLinx UniCode Functions 188 NetLinx Programming Language Reference Guide...
Страница 244: ...Appendix B Glossary 228 NetLinx Programming Language Reference Guide...
Страница 245: ...Appendix B Glossary 229 NetLinx Programming Language Reference Guide...