PROC 0 + /*---------------------------------------------------------------------+ | Copyright (c) 1996, SAS Institute Inc. | | Unpublished - All Rights Reserved | | S A S / C S A M P L E | | | | NAME: LL | | PURPOSE: This DEBUGGER example CLIST is used in Debug Session | | 11 in the SAS/C DEBUGGER USER'S GUIDE, pg. 163, which | | illustrates the transfer, dbinput, and dblog commands. | | These commands enhance communication between the | | SAS/C Debugger and the CLIST, and are issued to the | | Debugger by the CLIST rather than directly. | | | | INPUT/OUTPUT: termin window/log window | | USAGE: %ll | +---------------------------------------------------------------------*/ CONTROL ASIS /* CONTROL ASIS LIST SYMLIST CONLIST SET MORE = y SET FLINK = flink SET HEAD = head window clear log DO WHILE &MORE = y IF &TAG = + THEN DO dbinput TAG + "Linked list traversing clist. Enter name of structure:" END ELSE DO dbinput TEMP "Name of next structure (def &TAG):" IF &TEMP ^= + THEN SET TAG = &TEMP END dbinput MAP "Is a mapping of struct &TAG desired? (y for yes):" IF &MAP = y THEN + whatis (struct &TAG) dblog dbinput TEMP "Enter pointer to the 'start' of the list (def head):" IF &TEMP ^= + THEN SET HEAD = &TEMP dbinput TEMP "Enter name of link to the next element (def flink):" IF &TEMP ^= + THEN SET FLINK = &TEMP transfer THIS value &HEAD dblog You're now at &THIS.. Your options are: dblog dblog d - display this node" dblog f - move forward" dblog q - quit" dblog dbinput DIR "Enter option:" DO WHILE &DIR ^= q IF &DIR = d THEN DO print *(struct &TAG *)&THIS dblog dbinput RESPONSE + "Print any character strings in this structure?" IF &RESPONSE = y THEN DO dbinput CHARVAL "Which one?" print ((struct &TAG *)&THIS)->&CHARVAL %s dblog END END ELSE IF &DIR = f THEN DO transfer NEXT value ((struct &TAG *)&THIS)->&FLINK IF &NEXT = 0p00000000 THEN + dblog "end of list - can't move forward." ELSE + SET THIS = &NEXT END dblog You're now at &THIS.. Your options are: dblog dblog d - display this node" dblog f - move forward" dblog q - quit" dblog dbinput DIR "Enter option:" END dblog You may dump a structure + with a different (or the same) mapping. dblog Your options are: dblog dblog y - yes, dump another structure dblog n - no, I'd rather quit dblog dbinput MORE "Enter option:" END