S*Basic String Parsing Toolkit

            A number of string-related functions to help with
                            parsing text strings

They should be compatible with Qdos, Minerva and SMSQ/E, although, since
they use internal routines for some capabilities, there may be small
differences in their results depending on the OS used. Most of these
commands will be compatible with popular S*BASIC compilers, except in cases
where results are returned via the parameters. In some cases a small speedup
could have been achieved by writing them specifically for compilers and
SMSQ/E. Well, you have the source code, so its still possible to do that,
if you can and choose!


s$ = DETAB$(string$)
        Returns string$ with leading spaces and tabs removed

s$ = REVERSE$(string$)
        Returns string$ reversed

s$ = LOWER$(string$)
        Returns lowercased string$

s$ = UPPER$(string$)
        Returns uppercased string$

Note: Case translation uses simple routine that only includes some of the
"foreign" characters. Basically it goes like this for lowercase (and
opposite for uppercase):


        cmpi.b  #'A',d0
        blo.s   notran
        cmpi.b  #'Z',d0
        bls.s   mklo
        cmpi.b  #'Ä',d0         chr(160)
        blo.s   notran
        cmpi.b  #'Œ',d0         chr(171)
        bhi.s   notran

        subi.b  #' ',d0
        bra.s   notran

        addi.b  #' ',d0

        move.b d0,2(a6,a1.l)

Programmers notes:
Not all functions will be required in all cases in compiled programs,
therefore they have been re-written in a relatively modular fashion, so
that unwanted commands and their functional code may easily be removed. See
the link files for details. Most individual commands can be compiled on
their own, but since they rely on common library files, they may be
relatively bulky. If only one or two commands are required in a compiled
program, it is often better to omit the library files and insert your own
routines, eg to fetch and return parameters, etc.

Note: DETAB$ and REMOVE$ share a bulk of the same code, so combining the
two adds little overhead above having only one or the other.

Software status
V0.01, pjw, 10 Mar 2001
V0.02, pjw, 16 Nov 2003, various times: improvements and additions
V0.03, pjw, 21 May 2019, modularised and improved

You may use these routines in your own QL-related programs, provided you
suitably and proportionally accredit the author(s). See otherwise the
conditions set out on my web site www.knoware.no