PDUPLICATE procedure

Duplicates a pointer, with all its components (R.W. Payne).


No options


Parameters

OLDPOINTER = pointers
Pointers to duplicate

NEWPOINTER = pointers
Duplicated pointers


Description

PDUPLICATE is useful when you want to duplicate the complete tree of data structures to which a pointer points. So, it duplicates not only the pointer itself, but all the structures to which it points. Also, if any of these structures is itself a pointer, the structures to which that too points will be duplicated.

   The pointer to be duplicated is specified by the OLDPOINTER parameter, and the duplicated pointer is saved by the NEWPOINTER parameter.


Options: none.

Parameters: OLDPOINTER, NEWPOINTER.


Method

PDUPLICATE calls itself recursively to duplicate any pointers inside OLDPOINTER. The individual data structures are duplicated by the DUPLICATE directive.