User guide

eWON 500-2001-4001-4002 User Guide - Programming the eWON
eWON 500®2001®4001®4002® Version 4_3_0 - User Guide - 10/5/05 - ©ACT'L sa - Page 137
9.2.23 EOF
Syntax [function]
EOF E1
• E1 is the file number (1-4)
Purpose:
Returns 1 when end of file is reached.
EOF always returns 1 for files opened for write.
Example:
See also:
“CLOSE” on page 133, “GET” on page 138, “OPEN” on page 154, “PUT” on page 160
9.2.24 FCNV
Syntax [function]
FCNV E1, E2
• E1 is the string to be converted to an IEEE float representation.
• E2 is the parameter for the conversion, with comportment as follows:
Purpose:
Converts a string to its IEEE representation on 32 bits.
Example:
PRINT "open file"
OPEN "file:/usr/myfile.txt" FOR TEXT INPUT AS 1
ReadNext:
IF EOF 1 THEN GOTO ReadDone
A$ = GET 1
PRINT A$
GOTO ReadNext
ReadDone:
PRINT "close file"
CLOSE 1
x==1: convert A$(1 to 4) to a float IEEE representation with:
A$(1)== Mantissa MSB
A$(2)== Mantissa
A$(3)== Mantissa LSB
A$(4)== Exponent+ Sign
x==2: convert A$(1 to 4) to a float IEEE representation with:
A$(1)== Exponent+ Sign
A$(2)== Mantissa LSB
A$(3)== Mantissa
A$(4)== Mantissa MSB
Table 92: Convention for converting a string to its IEEE representation
ieee = 0.0
A$="1234"
A$(1) = Chr$(140)
A$(2) = Chr$(186)
A$(3) = Chr$(9)
A$(4) = Chr$(194)
ieee = FCNV A$,2
Print ieee
rem ieee = -34.432176