LineIn() versus CharIn()

[Autolink] Menu

Use the function CHARIN to read a file as often as possible (instead of using LINEIN). For example:

 
                        /* read a file into a variable                */
  fileContents = CharIn( myFile, 1, chars( myFile ) )

                        /* close the file                       v2.60 */
  call stream myFile, 'c', 'CLOSE'

See Read a file using CharIn() for an example routine to read a file using CHARIN and split it into lines manually.


[Back: Closing files]
[Next: Error handling & debugging]