%STR (Get or Store Null-Terminated String)

%STR(basing pointer{: max-length})(right-hand-side)
%STR(basing pointer : max-length)(left-hand-side)

%STR is used to create or use null-terminated character strings, which are very commonly used in C and C++ applications.

The first parameter must be a basing-pointer value. (Any basing pointer expression is valid, such as "%ADDR(DATA)" or "P+1".) The second parameter, if specified, must be a numeric value with zero decimal positions. If not specified, it defaults to the maximum allowed length for defining a character variable.

The first parameter must point to storage that is at least as long as the length given by the second parameter.

Error conditions:

  1. If the length parameter is less than 1 or greater than the maximum length allowed, an error will occur.
  2. If the pointer is not set, an error will occur.
  3. If the storage addressed by the pointer is shorter than indicated by the length parameter, either
    1. An error will occur
    2. Data corruption will occur.

For more information, see String Operations or Built-in Functions.



[ Top of Page | Previous Page | Next Page | Contents | Index ]