home *** CD-ROM | disk | FTP | other *** search
- ; Title : MENUONE.TSK Last Updated : March 21, 1991
- ; Author : Steve Johnson - FmP. Version : 1.10
- ; Purpose : Simple menu illustrating use of timeout.
- ; Notes : A more practical example would allow parameters and paths
- ; to be defined. The timeout would return you to a login
- ; screen.
- ; Latest : New syntax for SAVE and RESTORE
- ; : Abandon use of ELEVEL.BAT
-
- int line
-
- var application,20 ; the current application
- var database,20 ; ditto
- var null,1
- var response,80
- var spreadsheet,20 ; ditto
- var tname,8," MENUONE"
- var wordprocessor,20 ; edited by option 4
-
- vconst attention,79 ; highlight for timeout message
- vconst cel,55 ; clear to end of line
- vconst cep,56 ; clear to end of page
- vconst cls,11 ; clear screen and home cursor
-
- end
-
- forms logon.ovr ;in case /q and registered
- lookfor "menuone.ovr"
- if not found
- insert tname tname
- put "NO_FORMS"
- stop
- fi
- lookfor "menuone.tm"
- if found
- restore "menuone.tm" wordprocessor database spreadsheet
- if resp ne 0
- wait "MENUONE: Failure during restoration of data"
- stop
- fi
- restore
- fi
- forms menuone.ovr
- move 8000h to bbmask ;enable the <esc> key
- move true to hide ;dont show programs names
- move 30 to timer ;timeout in seconds
- cursor 0 25
- menu 1,"MENU" ;display the menu
- option 1,1 ;all options execute same basic code
- option 1,2
- option 1,3
- userline ;prevents TM switching to 24 line mode
- cursor 20 0 cep ;clear bottom of screen
- if choice = 1 ;first topic was highlighted
- move wordprocessor to application
- else
- if choice = 2 ;second topic was highlighted
- move database to application
- else
- move spreadsheet to application ;must have been the third...
- fi
- fi
- trim application
- if application ne null
- move 255 to elevel
- run application
- add 1 to choice giving line
- if elevel ne 0 ;display message on appropriate line
- cursor line 47 "Error " elevel cel
- else
- clear response
- scanvid 20 giving response
- cursor 20 0 cel
- sizevar response 32
- cursor line 47 response cel
- fi
- else
- display attention "Please enter application name via define option!"
- clear bbdisp
- fi
- return
- option 1,4 ;present program names for editing
- fieldfill wordprocessor database spreadsheet
- put "APPS_LIST"
- if not anyfk
- get wordprocessor database spreadsheet
- save "menuone.tm" wordprocessor database spreadsheet
- if resp ne 0
- wait 'MENUONE: Unable to save data'
- stop
- fi
- save
- fi
- return
- option 1,5 ;highlighted "quit" topic
- option 1,30 ;pressed <esc> key
- stop
-
- ; the following code only executed after a timeout
- option 1,99 ;timed out
- cursor 12 15 attention " Sorry you have been timed out "
- wait 2
- stop
- endm 1
- endtask
-
- @VIDEO
- @nf MENU
- @bright
- @col char,white,blue
- @window line 0,column 15,depth 11,width 29
- @GON
- @BBMENU yellow,blue
- 7-----------------------------9
- 0 7---------------------9 0
- 0 0 {Wordprocessing } 0 0
- 0 0 {Database } 0 0
- 0 0 {Spreadsheets } 0 0
- 0 0{Define Applications }0 0
- 0 4---------------------6 0
- 0 0 {Quit } 0 0
- 0 1---------------------3 0
- 0This menu will time out after0
- 0 30 seconds of inactivity 0
- 1-----------------------------3
- @END
- @nf APPS_LIST
- @acceptfk f10
- @string
- @string
- @string
- @colour char,yellow,black
- @WINDOW LINE1,COLUMN41,DEPTH6,WIDTH38
- @colour char,yellow,blue
- @bright
- @GON
- 9 1-Edit-and-<>:------9
- 4----[ ]0
- 4----[ ]0
- 4----[ ]0
- 0 Please Note: 0
- 6 Full hierarchical name 0
- 0 required unless on PATH0
- 3 7---F10=Quit------------3
- @end
- @eof
-