Specifications
Section 11. String Functions
11-3
Parameter
& Data Type
Enter
Float
Variable or
Constant
The variable or constant that holds the floating point value to be converted.
Determines how the floating point value will be represented in the
converted string. Note that the format string must be enclosed in quotes.
The options are (m = mantissa; d = decimal; x = exponent):
%f Decimal notation in the form of +mmm.dddddd;
precision is 6 places to the right of the decimal
%e (or %E) Decimal notation in the form of +m.dddddd e+xx;
precision is 6 places to the right of the decimal
%g (or %G) Mantissa and decimal are variable; trailing 0s and
decimals are omitted
%Y.Zf Decimal notation in the form of +m.d; precision is
defined by Y places to the left of the decimal and Z
places to the right of the decimal
%Ye (or %YE) Decimal notation in the form of +m.d e+xx; precision is
defined by Y characters to the right of the decimal
FormatString
Constant
%Yg (or %YG) Mantissa and decimal are variable; precision is defined
by Y
FormatFloat Example
The following program shows the use of the FormatFloat instruction. Using the
software's numeric monitor, enter a value into FloatVal that should be
converted into a string.
Public FloatVal as Float
Public StringVal as String * 20
BeginProg
Scan (1,Sec,3,0)
StringVal = FormatFloat (FloatVal,"%f")
NextScan
EndProg
InStr (Start, SearchString, SoughtString, SearchOption )
Used to find the location of a string within a string.
Syntax
Variable = InStr (Start, SearchString, SoughtString, SearchOption )
Remarks
This instruction returns the integer position of the SoughtString parameter. If
the SoughtString is not found, the instruction returns 0.
This instruction returns the integer position of the FilterString parameter. If the
FilterString is not found, the instruction returns 1.