Programmer Guide > Working with Text > Using Non-string and Non-scalar Arguments
  

Using Non-string and Non-scalar Arguments
Most of the string processing routines described in this chapter expect at least one argument, which is the string on which they act.
If the argument is not of string type, it is converted to string type according to the same default formatting rules that are used by the PRINT, or STRING routines. The function then operates on the converted result. Thus, the statement:
PRINT, STRLEN(23)
returns the result:
8
because the argument 23 is first converted to the string '          23' which happens to be a string of length eight.
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:
; Get an uppercase version of TREES.
A = STRUPCASE(TREES)
; Show that the result is also an array.
INFO, A
; Display the original.
PRINT, TREES
; Display the result.
PRINT, A
results in the 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 PV‑WAVE Reference.

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.