Passing Collection Elements

Ordered map element values, being variable length strings or unformatted blobs, may be passed as parameters to functions, procedures and subroutines just as you would an ordinary S,0 (dynamic string) or X,0 (dynamic unformatted blob) variable or expression. But note that since references to ordered map elements are essentially expressions, they're effectively read-only and thus attempts to update them via XPUTARG will have no effect. For example:

call FoldUpper($capitals("california")) ! passes "sacramento"

print $capitals("california")           ! (unchanged by procedure)

...

Procedure FoldUpper(name$ as s0)

    name$ = ucs(name$)

    xputarg 1,name$   ! this doesn’t change calling param

                      ! (if it was an ordered map value)

EndProcedure