GDSX (Extended General Device Support) Manual

User Exit Descriptions
Extended General Device Support (GDSX) Manual529931-001
9-11
USER^BACKUP
Pseudo procedures may be called from this procedure.
Example
Here is an example of USER^BACKUP code that checkpoints data input at a terminal.
Obtaining the checkpoint semaphore is not necessary, because TSCODE is not
checkpointing and no user task exists. Also, calling DO^CP is not necessary, because
after exiting USER^BACKUP a DO^CP is done automatically by the backup task.
BLOCK USER^PRIVATE;
INT AREA[0:11];
END BLOCK;
.
PROC USER^BACKUP;
BEGIN
INT t, flags;
INT TRM1 [0:11];
INT .Buffer;
INT writecnt := 20,
cnt := 0;
TRM1 ':=' ["$SURF ",8 * [" "]];
flags := 1;
CALL ^open ( TRM1, t, flags );
IF <> THEN Call DEBUG; ! DO ERROR HANDLING
@buffer := GETLOCALPOOL (0 , 10);
buffer ':=' ["Takeover!>", 5 * [" "]];
CALL ^WRITE (t, buffer, writecnt);
IF <> THEN
BEGIN
CALL PUTLOCALPOOL (0,buffer);
Call DEBUG; ! DO ERROR HANDLING
RETURN;
END;
CALL ^Awaitio(t, @buffer, cnt);
IF <> THEN
BEGIN
CALL PUTLOCALPOOL (0,buffer);
Call DEBUG; ! DO ERROR HANDLING
END;
area ':=' buffer for 20; !copy data to user global area
!Note: buffer gotten with GETLOCALPOOL
!is checkpointed with ^checkpoint(2)
!if so desired (not done here).
! We checkpoint only user global variables with Q^CP!
t := Q^CP (area,10);
! CALL DO^CP is not necessary because after exiting