PPWIZARD Manual
[Bottom][Contents][Search][Prev]: Standard Rexx Routines[Next]: Rexx Extensions

Rexx Fragments - Kick Start

You can get a (slighty out of date) regina rexx manual from http://sites.netscape.net/ssatguru, this has HTML and compiled Windows Help formats for download.

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;
    


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

PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Tuesday January 02 2001 at 7:37am