Navigation:  thinBasic Modules >

FileLine

Previous pageReturn to chapter overviewNext page

 

Description

 

FileLine module provides support for reading lines coming from sequential text files of different operating systems: Windows, Unix, Mac

As you may know, every of the above mention OSs produce text files with different end of line delimiter: Windows uses $CRLF pairs, Unix uses $LF, Mac uses $CR.

 

More information about end of line delimiter can be found at: http://en.wikipedia.org/wiki/Newline

 

FileLine module implements few new keywords that will let programmer to easily parse text files sequentially reading lines regardless what end of line delimiter is found inside them.

 

How to use this module

 

Inside your script, before calling any module specific keyword, add the following:

 

USES "FILELINE"

 

Restrictions

 

 

Important notes about FileLine module

 

1.impossible to distinguish multiple consecutive end of line delimiters.
Multiple consecutive end of line delimiter will be considered just once. So if multiple $CRLF or $LF or $CR are found, they will be counted just once. This can be a problem when counting lines in a file that has empty lines. Empty lines will just be ignored by internal counting.
 

 

 

© 2004-2008 thinBasic. All rights reserved. Version 1.7.0.0 Web Site: http://www.thinbasic.com