View previous topic :: View next topic
|
Author |
Message |
malli419
New User
Joined: 16 Apr 2012 Posts: 5 Location: india
|
|
|
|
Hi am new to pl1 and and want to know the used of DEFINED keyword
Eg:DCL 1 IN_LOC DEFINED IN_REC |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
The manuals will explain it all. |
|
Back to top |
|
|
senthilnathanj
New User
Joined: 31 Jul 2007 Posts: 47 Location: chennai
|
|
|
|
Hi,
The DEFINED attribute indicates that PL/I is not to allocate storage for the variable, but is to map the description of the variable onto the storage of another variable called the base variable. The DEFINED attribute provides a way to access the same data using different names .
Code: |
DECLARE NAMES(10) CHARACTER(5) DEFINED (LIST),
LIST(10) CHARACTER(5) |
In this example, 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.
Please correct me if i am wrong. |
|
Back to top |
|
|
malli419
New User
Joined: 16 Apr 2012 Posts: 5 Location: india
|
|
|
|
Thanks dear |
|
Back to top |
|
|
malli419
New User
Joined: 16 Apr 2012 Posts: 5 Location: india
|
|
|
|
Thank you |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
DEFINED is not deprecated (and won't be ever) , but using UNION is nowadays the preferred alternative and results in better code (and, like based, allows you to overlay anything with anything) |
|
Back to top |
|
|
|