Non-string and Non-scalar Arguments
Most of the string processing routines described in this chapter expect at least one argument — the string on which they act. If the argument is not of type string, IDL converts it to type string using the same default formatting rules that are used by the PRINT/PRINTF or STRING routines. The function then operates on the converted result. Thus, the IDL statement,
returns the result
because the argument "23" is first converted to the string ' 23' that happens to be a string of length 8.
If the argument is an array instead of a scalar, the function returns an array result with the same structure as the argument. Each element of the result corresponds to an element of the argument. For example, the following statements:
; Create array of trees. trees = ['Beech', 'Birch', 'Mahogany', 'Maple', 'Oak', $ 'Pine', 'Walnut'] ; Get an uppercase version of TREES. A = STRUPCASE(trees) ; Show that the result is also an array. HELP, A ; Display the original. PRINT, trees ; Display the result. PRINT, A
produce the following output:
A STRING = Array(7) Beech Birch Mahogany Maple Oak Pine Walnut BEECH BIRCH MAHOGANY MAPLE OAK PINE WALNUT
For more details on how individual routines handle their arguments, see the individual descriptions in the IDL Reference Guide.