FINPUT statement

Purpose: FINPUT will input, from a file, lines of comma separated values into a parameter list of comma separated variables in a manner similar to the QBasic INPUT # function. The values in the file can be any of string, integer or floating point data types.


 Syntax:

 FINPUT hFile, Variable1, Variable2, ...

 Parameters:

  • hFile Name of handle to file from which variable values will be retrieved.
  • Variable1, Variable2, ... Parameter list of comma separated variables which will receive the corresponding values from the file. The data type of these variables can be any of string, integer or floating point data types.

Example:

 
 DIM P, N!, E#, L!, D$, j
 
 OPEN "TEST.TXT" FOR OUTPUT AS FP1
 
 FOR j = 1 TO 10
   FPRINT FP1, j , ",", RND * j * 100, ",", 12356789.012345, ",", j + 10, ",", "This string has spaces"
 NEXT
 
 CLOSE FP1
 
 OPEN "TEST.TXT" FOR INPUT AS FP1
 
 WHILE NOT EOF(FP1)
   FINPUT FP1, P, N!, E#, L!, D$
   PRINT P, " ", N!, " ", E#, " ", L!, " ", D$
 WEND
 
 CLOSE FP1