Ftoa; Get_Buffer_Char; Get_Buffer_String - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Reserved Identifiers
Keywords & Run-Time Library Functions (Cont.)
FORMAT (Cont.)

FTOA

GET_BUFFER_CHAR

GET_BUFFER_STRING

128
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
FORMAT('%-5.2f',123.234)
FORMAT('%5.2f',3.234)
FORMAT('%+4d',6)
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)
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.
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.
NetLinx Programming Language Reference Guide
Result of FORMAT function
'123.23'
'3.23'
'+6'
// STRING = '123.4'

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents