Use the $GLOBAL() function to allocate global variables that contain strings longer than 80 characters.
The $GLOBAL() function has this syntax.
result = $GLOBAL(ALLOC,&name,length)
The $GLOBAL() function takes these arguments.
|
result |
Null string if the operation was successful. Otherwise, error text is returned. |
|
&name |
Name of a global variable to be allocated. This variable must not have been previously used in any manner. If the name is coded directly in the function, it must be enclosed in single or double quotes. The name may also be placed in another variable and that variable name specified as the argument. |
|
length |
Number of bytes to be reserved for data. Future assignments of data strings may take any length up to this value. |
The $GLOBAL() function produces these return codes:
|
101 - 103 |
ARG n MISSING OR INVALID |
Example
result = $global('alloc','&bigvar',1000)
vname = '&bigvar'
result = &global('alloc',vname,500)
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |