A library for parsing values from text files.
File: |
Parser.lib |
Version: |
1.0 |
Author: |
Marcus Johansson |
Details
Constants
Sub routines
The Parser library lets you read integers, floats and strings from text files.
Value types. |
||
Name |
Description | |
P_TYPE_INT |
Integer. |
|
P_TYPE_FLOAT |
Float. |
|
P_TYPE_STRING |
String. |
|
P_TYPE_CHAR |
Character. |
|
P_TYPE_EOL |
End of line. |
|
P_TYPE_EOF |
End of file. |
Name |
Parameters |
Brief description |
|
procedure |
Reset parser. |
||
function |
f |
Get next value. |
|
procedure |
f |
Skip line. |
|
function |
char |
Return true if parameter is an alphabetic character. |
|
function |
char |
Return true if parameter is a numeric character. |
procedure Reset ( )Resets the parser. You should call this before starting to parse values from a file. [ Back ] |
function GetNext? ( f )This function finds the next integer, float or string value in file 'f'. Note that the file must be opened in BINARY mode. Check the 'type' field of the returned object to determine the value type. If the type is 'P_TYPE_INT' you will find the integer value in the 'i' field. If the type is 'P_TYPE_FLOAT', the field 'f#' holds a floating point value. For 'P_TYPE_STRING' a string value is stored in the 's$' field. And for 'P_TYPE_CHAR' a character in string format can be found in the 'c$' and the same character as an integer in the 'i' field. Type 'P_TYPE_EOL' and 'P_TYPE_EOF' represents the end of a line or the file. Text within double quotes are treated as single strings and returned as 'P_TYPE_STRING'.
Return value [ Back ] |
procedure SkipLine ( f )Call this function to skip the rest of the line. [ Back ] |
function IsAlpha ( char )Return true if parameter is an alphabetic character.
Return value [ Back ] |
function IsDigit ( char )Return true if parameter is a numeric character.
Return value [ Back ] |
Generated with NLDoc 20140630.