PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
[Bottom][Contents][Search][Prev]: Rexx Looping[Next]: Standard Rexx Routines
\ -> Rexx -> Rexx Parsing

Rexx Parsing

You can get a rexx manuals (for regina) from http://www.lightlink.com/hessling/, there are HTML and PDF versions available.

Parsing is another of rexx's complex areas, a subset of its syntax is summarised here:

PARSE [UPPER] LINEIN [template]
PARSE [UPPER] NUMERIC template
PARSE [UPPER] VAR symbol template
PARSE [UPPER] VALUE expression WITH template

    template        -> [firstPosition] assignments [assignments]
    assignments     -> [nextPosition] varlist [stopPosition]
    varlist         -> varname ' ' [varlist]
    varname         ->   "non-constant symbol"
                       | '.'
    firstPosition   -> position
    nextPosition    -> position [nextPosition]
    stopPosition    -> position
    position        ->   searchPosition
                       | absPosition
                       | relPosition
                       | '(' "expression" ')'
    searchPosition  -> "string constant"
    absPosition     ->   "integer"
                       | '=' numexpr
    relPosition     ->   '+' numexpr
                       | '-' numexpr
    numexpr         ->   "integer"
                       | '(' "integer expression" ')'

This is an example of extracting each directory (one at a time) from the path (located in DOS or OS/2 environment):

;--- Get "PATH" from environment
#evaluate ^^  ^_Path = GetEnv('PATH')^

;--- Start list -----------------
<P>The path is:
<OL>

;--- List Components ------------
#{
   ;--- Get next directory name -
   #evaluate ^^ ^parse var _Path _ThisBit ';' _Path^

   ;--- Exit if at end of path --
   #if  _ThisBit = '' & _Path=''
        #break
   #endif

   ;--- Output directory name ---
   <LI><??_ThisBit>
#}

;--- End list -------------------
</OL>


email me  any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Search][Prev]: Rexx Looping[Next]: Standard Rexx Routines


PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Saturday May 28 2022 at 2:55pm