theHandle= NewHandle( 1000 ); /* allocate 1000-byte storage */ strcpy( *theHandle, "copy me" ); /* single indirection to get addr */
byte0 = **theHandle; [TOKEN:12074] double indirection to get data */
byte5 = **theHandle[4];
typedef struct {
char myByte;
short myInt;
} MyStruct, *MyStructPtr, ** MyStructHandle;
MyStructHandle theHandle; /* create a pointer to a pointer to a MyStruct
*/
MyStructPtr thePtr;
theHandle=(MyStructHandle)NewHandle(sizeof(MyStruct)); /* allocate */
/* Fill the handle with data */
theByte = (*theHandle)->myByte; /* fetch a data element */
theByte = (**theHandle).myByte; /* alternate syntax; same action */
thePtr = *theHandle; /* dereference Handle, see below */
HLock( theHandle ); Û/* lock the data in place */ theByte = thePtr->myByte; /* more direct access to the data */
HUnlock( theHandle ); Û/* let the data float */ theByte = thePtr->myByte; /* Dangerous!, Handle is unlocked!
*/