/* * ----------------------------------------------------------------- * Execution of this macro requires a license for uni-XEDIT Extended * for each concurrent user of the macro. * ----------------------------------------------------------------- * * * * reshow.xedit - Display selected entries in address book for * review or update * * Called by the adbook program * * Modification History * * 01/10/93 twg Initial implementation * */ cardfile = getenv('TWGCARDFILE') /* get address book file name */ cardfile = strip(cardfile,b) lineno = getenv('TWGADBOOK') /* get starting line number of found entry */ lineno = strip(lineno,b) /* * Variable initialization */ thisline = '' string. = '' data. = '' i = 0 call lineout cardfile /* * Get data for display */ do until left(thisline,10) = '==========' i = i + 1 thisline = linein(cardfile,lineno) parse var thisline string.i ':' data.i lineno = lineno + 1 end call lineout cardfile /* * Set up initial display and cursor position */ 'extract /lscreen' /* determine screen length */ if lscreen.1 < 23 then do /* if insufficient, message and quit */ say '' say 'Insufficient lines to display template' say '' say 'You must have at least 23 lines' say '' say 'Terminating...' 'qq' exit end 'set msgline on 'lscreen.1 'set cmdline off' 'set scale off' 'set prefix on left' 'set prefix nulls' 'set linend off' /* allows use of # character */ 'next *' 'cursor screen 1 1' /* position cursor in first field */ /* * Control character definitions */ 'command set ctlchar % escape' 'command set ctlchar @ protect' 'command set ctlchar & noprotect' 'command set ctlchar ! noprotect invisible' /* * Display screen and process user response */ do forever call display_screen /* call display routine */ read nochange tag /* get data entered, key pressed */ do queued() parse pull key line column string if key = 'PFK' then if line = 3 then do command qquit exit end else 'emsg PF Key' line 'is invalid in this application' else 'emsg Update not permitted in this mode - Press PF3 to exit' end /* do queued */ end /* do forever */ exit display_screen: /* * Display screen */ 'set reserved 1 nohigh' 'set reserved 2 nohigh' 'set reserved 3 nohigh %@ -------- Selected Address Record --------%@' 'set reserved 4 nohigh' 'set reserved 5 nohigh %@ Review only - Update not supported in this mode %@' 'set reserved 6 nohigh' 'set reserved 7 nohigh' j = i - 1 /* number of members of string. and data. arrays */ do n = 1 to j k = 7 + n /* next line for output */ 'set reserved' k 'nohigh %@' string.n':' data.n '%@' end k = k + 1 do 2 'set reserved' k 'nohigh' k = k + 1 end 'set reserved' k 'nohigh %@ Press F3 to exit' /* * Fill in remainder of screen display */ do l = k+1 to lscreen.1 'set reserved' l 'nohigh' end return