/* * ----------------------------------------------------------------- * Execution of this macro requires a license for uni-XEDIT Extended * for each concurrent user of the macro. * ----------------------------------------------------------------- * * * * address.xedit - Address Book Application Screen Display * * * This macro displays the screen for adding new entries to the * electronic address book. It also adds the data to the address * book file. It gets the name of file from the environment * variable TWGCARDFILE, set by the adbook program * * The application requires minimally 23 lines of screen display. * * Modification History: * * 01/10/93 twg Initial implementation * */ /* GET ADDRESS BOOK FILE NAME */ cardfile = getenv('TWGCARDFILE') cardfile = strip(cardfile,b) /* SET UP INITIAL SCREEN DISPLAY AND POSITION CURSOR */ 'extract /lscreen' /* determine screen length */ if lscreen.1 < 23 then do /* if insufficient, message and exit */ 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 5 21' /* 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' /* DETERMINE USER RESPONSE AND KEY PRESSED AND UPDATE CARDFILE */ do forever call display_screen /* call display routine */ read nochange tag /* get data entered, key pressed */ do queued() parse pull key line column string select when key = 'RES' then do /* if reserved line, */ select when line = 5 then string = 'Last Name: 'string when line = 6 & column = 21 then string = 'First Name: 'string when line = 6 & column = 64 then string = 'Initial: 'string when line = 7 then string = 'Title: 'string when line = 8 then string = 'Company: 'string when line = 9 then string = 'Address: 'string when line = 10 then string = 'Address(2): 'string when line = 11 then string = 'Address(3): 'string when line = 12 then string = 'City: 'string when line = 13 & column = 21 then string = 'State: 'string when line = 13 & column = 56 then string = 'Zip Code: 'string when line = 14 & column = 21 then string = 'Phone: 'string when line = 14 & column = 52 then string = 'Fax No.: 'string otherwise say 'Check your data' end /* end select which line number */ call lineout(cardfile,string) /* store data entered */ call lineout(cardfile) end /* end do for when key='RES' */ when key = 'CMK' then say 'keybound key' when key = 'CMD' then /* if command entered, error message */ 'emsg COMMAND "'line'" IS INVALID IN THIS APPLICATION' when key = 'ETK' then do cursor screen 5 21 end /* end do for key='ETK' */ when key = 'PFK' then if line = 3 then do /* if PF3 pressed, qquit */ command qquit exit end /* end do if PFK3 pressed */ else /* if PFK but not PF3, display error message */ 'emsg PF KEY 'line' IS INVALID IN THIS APPLICATION' end /* end select for key= */ end /* end do queued */ call lineout(cardfile,copies('=',70)) /* separator line */ call lineout(cardfile) end /* end do forever */ exit display_screen: /* SETUP SCREEN DISPLAY */ 'set reserved 1 nohigh' 'set reserved 2 nohigh' 'set reserved 3 nohigh %@ ' copies('-',25)'Address Record'copies('-',25)'%@' 'set reserved 4 nohigh' 'set reserved 5 nohigh %@ Last Name: %& %@' 'set reserved 6 nohigh %@ First Name: %& %@ Middle Initial: %& %@' 'set reserved 7 nohigh %@ Title: %& %@' 'set reserved 8 nohigh %@ Company: %& %@' 'set reserved 9 nohigh %@ Address: %& %@' 'set reserved 10 nohigh %@ (#2) %& %@' 'set reserved 11 nohigh %@ (#3) %& %@' 'set reserved 12 nohigh %@ City: %& %@' 'set reserved 13 nohigh %@ State: %& %@ Zip Code: %& %@' 'set reserved 14 nohigh %@ Phone: %& %@ Fax No.:%& %@' 'set reserved 15 nohigh %@' 'set reserved 16 nohigh %@ ' copies('-',64)'%@' 'set reserved 17 nohigh' 'set reserved 18 nohigh %@ Press TAB to move from field to field' 'set reserved 19 nohigh' 'set reserved 20 nohigh %@ Press ENTER to save information' 'set reserved 21 nohigh' 'set reserved 22 nohigh %@ Press F3 to exit' /* FILL IN REMAINDER OF SCREEN DISPLAY */ do i = 23 to lscreen.1 'set reserved' i 'nohigh' end return