Parse a line of exprt-type text (IMport PARSE)


Very basic! (but can save lots of fiddly S*BASIC statements!)

Compatible with PSION export format strings.


        error% = IMPARSE(statement$, import_line$)

        error% can be bp, xp, bl (quote error), or ef (end of import line)

        statement$ will contain the last statement parsed

        import_line$ is one line (record/column etc) of an import file

By repeatedly calling IMPARSE statements are extracted one by one from the
import line and put into statement$, while the import_line$ is
correspondingly truncated, until error = -10 (or LEN(import_line$) = 0).

On error, parsing stops at that point and cannot proceed until syntax
issue in import_line$ is rectified.

Numerical data, ie data not contained in double quotes, is not tested for
conformity to QDOS standards but is treated as a string.

Import line syntax is:

An import_line$ consists of <term> {,<term>}

<term>    = "<string>" | <number>

<string>  = "<empty>" | "<chars (0..255, except 34 (double quote))>"

<number>  = <initial> + <chars (0..255, except 44 (comma))>

<initial> = <digit> | <dot> | <minus> | <dollar>

Note: All strings must be contained in double quotes
Note: There must be no spaces between terms, eg <term>, <term> is wrong.

Program Status

V0.01, pjw, 1992 Mar 27, Initial version
V0.02, pjw, 2021 Jan 13, Made compatible with Pick 'n' Mix toolkit

Program status and DISCLAIMER as per