
Reserved Identifiers
128
NetLinx Programming Language Reference Guide
Keywords & Run-Time Library Functions (Cont.)
FORMAT (Cont.)
The result is a formatted text string.
fTemperature = 98.652
STR = FORMAT('The current temperature is
%3.2f',fTemperature)
// Displays "The current temperature is 98.65"
The table below shows some examples of the output of
FORMAT
for several dif-
ferent format lines and values:
FORMAT
Statement Result of
FORMAT
function
FORMAT('%-5.2f',123.234) '123.23'
FORMAT('%5.2f',3.234) '3.23'
FORMAT('%+4d',6) '+6'
FTOA
This function converts a floating-point value to an ASCII string containing the
decimal representation of the number.
CHAR[ ] FTOA (DOUBLE Num)
Parameters:
•
Num
: Floating-point number to convert to a decimal string.
The result is a character string that contains the decimal representation of the
specified floating-point number. The character representation will use expo-
nents if necessary.
STRING = FTOA(123.4) // STRING = '123.4'
GET_BUFFER_CHAR
This keyword removes characters from a buffer.
Result = GET_BUFFER_CHAR (Array)
Array may be either a character array or wide character array; the operation is
identical in either case.
The result is a
CHAR
or
WIDECHAR
value depending on the variable type of
Array.
GET_BUFFER_CHAR
has a two-part operation:
1. Retrieve the first character in the buffer.
2. Remove the retrieved character from the buffer and shift the remaining
characters by one to fill the gap.
GET_BUFFER_STRING
This function removes characters from a buffer.
Result = GET_BUFFER_STRING (Array, Length)
Array may be either a character array or wide character array; the operation is
identical in either case. Length is the number of characters to remove.
Result is a
CHAR
or
WIDECHAR
value depending on the variable type of Array.
GET_BUFFER_STRING
has a two-part operation:
1. Retrieve <length> number of characters from the buffer.
2. Remove the retrieved character from the buffer and shift the remaining
characters up to fill the gap.
Summary of Contents for NETLINX PROGRAMMING LANGUAGE
Page 15: ...Table of Contents xiii NetLinx Programming Language Reference Guide...
Page 16: ...xiv NetLinx Programming Language Reference Guide Table of Contents...
Page 18: ...Introduction 2 NetLinx Programming Language Reference Guide...
Page 76: ...Language Elements 60 NetLinx Programming Language Reference Guide...
Page 106: ...Combining Devices Levels and Channels 90 NetLinx Programming Language Reference Guide...
Page 112: ...Master To Master M2M 96 NetLinx Programming Language Reference Guide...
Page 182: ...Reserved Identifiers 166 NetLinx Programming Language Reference Guide...
Page 204: ...NetLinx UniCode Functions 188 NetLinx Programming Language Reference Guide...
Page 244: ...Appendix B Glossary 228 NetLinx Programming Language Reference Guide...
Page 245: ...Appendix B Glossary 229 NetLinx Programming Language Reference Guide...