How To Use the Modifiable Pointer Descriptor - TPTR
How to construct TPTR:
· Through another descriptor pointer that can be modified. ANOTHER Modifiable Pointer Descriptor.
EG: TPTR PTR1;
TPTR PTR2 (PTR1);
· A buffer descriptor that cannot be modified Use the des () method.
EG: _LIT (KTEXT, "Hello World!"); _ LIT (KexTratext, "& Hi");
TBUFC <16> BUF1 (KTEXT);
TPTR PTR = buf1.des (); ... ptr.delete ((ptr.length () - 1), 1); ptr.Append (KexTratext);
· With a pointer to memory and this pointer has a clear maximum length.
· With a pointer to memory, this pointer has a clear maximum length and data length.
EG: TTEXT STR [16] = {'h', 'A', 'V', 'E', '', 'A', '', 'N', 'I', 'C', 'E' , '', 'D', 'A', 'Y', '/ 0'};
TPTR PTR (& Str [0], 15, 16);
Convert Litral to PTR:
_LIT (ktext, "hi there"); ... ptr = ktext; or ptr.copy (ktext);