In the following example:
SMALL: PROCEDURE OPTIONS (MAIN);
/* The variable NAMES is a defined variable; its data */
/* description is mapped to the storage occupied by */
/* the variable LIST. Any reference to NAMES or to */
/* LIST is resolved to the same location in memory. */
DECLARE NAMES(10) CHARACTER(5) DEFINED (LIST),
LIST(10) CHARACTER(5);
DCL P1 POINTER, P2 POINTER;
NAMES(1) = 'NAME1';
DISPLAY('NAMES(1) is "' || NAMES(1) || '"');
DISPLAY('LIST(1) is "' || LIST(1) || '"');
P1 = ADDR(NAMES);
P2 = ADDR(LIST);
DISPLAY('P1 is ' || HEX(P1));
DISPLAY('P2 is ' || HEX(P2));
END;
The compiler declares this error:
defined.pli(19:2) : IBM1246I E Argument to ADDR built-in should be CONNECTED.
For the ADDR(NAMES) line.
Why would NAMES not be considered CONNECTED? And furthermore, you can't decorate NAMES
with the CONNECTED attribute (as CONNECTED only applies to parameters and descriptors.)
Is there no way to determine the ADDRess of a DEFINED variable?
tdr