PPWIZARD Manual
[Bottom][Contents][Search][Prev]: ReplaceStringCI()[Next]: RexxVarDefined()

ReverseArray()

This is a rexx function provided by PPWIZARD. This routine (like all PPWIZARD extensions) can be used with any operating system supported by PPWIZARD.

This function is used to reverse the order of elements in an array. The "array" has numeric indexes with the ".0" element holding the number of elements.

The function takes a single parameter which is the name of the array (without dot).

The routine returns the number of items in the array.

Silly Example

    ;--- Set up the array -----------------------
    #evaluate ''               \
              ^                \
                A.1 = "5345";  \
                A.2 = "4123";  \
                A.3 = "61743"; \
                A.4 = "1678";  \
                A.0 = 4;       \
              ^
    
    ;--- Sort array & Reverse order & display ---
    #evaluate '' ^call SortArray "A"^
    #evaluate '' ^call ReverseArray  "A"^
    #evaluate '' ^do I = 1 to A.0; say a.i; end;^
    


[Top][Contents][Search][Prev]: ReplaceStringCI()[Next]: RexxVarDefined()

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