PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
Rexx Fragments - Kick Start |
You can get a rexx manuals (for regina) from http://www.lightlink.com/hessling/, there are HTML and PDF versions available.
This section will show you some small portions of rexx code (not complete) which can be used to quickly get you up to speed in rexx.
Note that the examples below are isolated fragments, you could not cut and paste them and run them though PPWIZARD as they are...
;--- Assign a value to a variable --- SomeVariable = 'the cat sat on the mat'; ;--- Convert string to upper case --- UpperCaseString = translate(SomeVariable); ;--- Get first 2 characters of string --- Left2 = left('abcd', 2); ;--- Get last 2 characters of string --- Right2 = right('abcd', 2); ;--- Get middle 2 characters of string (first char at posn 1) --- Middle2 = substr('abcd', 2, 2); ;;Last '2' is length ;--- See if first char of string is 'A' (either case) --- if translate(left(UpperCaseString, 1)) = 'A' then do; ;--- Any number of rexx statements --- end; ;--- Does "SomeVariable" contain the characters "Fred"? --- if pos('Fred', SomeVariable) <> 0 then ;Does var SingleStatement; else do ;--- Any number of rexx statements --- end; ;--- Is the second word of "SomeVariable" the word "the"? --- if word(SomeVariable, 2) = 'the' then SingleStatement;