COBOL Pointer variable

来源:互联网 发布:剑灵捏脸数据图人男 编辑:程序博客网 时间:2024/06/05 05:45

How to define a pointer variable


Define a pointer variable in Working-Storage Section


01  SILLY-POINTER                USAGE IS POINTER.


or


01  POINTERS-AND-OTHER-STUFF.    05  SILLY-POINTER            USAGE IS POINTER.    05  SILLY-VALUE              REDEFINES        SILLY-POINTER            PIC S9(8) COMP.




Set pointer variable

Set from a regular variable

SET SILLY-POINTER TO ADDRESS OF RECORD-1.


RECORD-1 is a general variable in Working-Storage Section.


Set from another pointer

SET SILLY-POINTER TO SILLY-POINTER2.


SILLY-POINTER2 is another pointer type variable; so SILLY-POINTER and SILLY-POINTER2 point to same address.


Set to null

SET SILLY-POINTER TO NULL.



0 0
原创粉丝点击