home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
optmen.zip
/
OPTDEMO.PRG
< prev
next >
Wrap
Text File
|
1987-02-22
|
2KB
|
81 lines
*
*
* OPTDemo - Demo programs for use of opt menu procedure
*
* by Anthony T. DeHart - GENIE (ATDEHART)
***** Setup Program States
set talk off
set echo off
set status off
set scoreboard off
set bell off
set exact off
set confirm on
set deleted on
***** Global Arrays for menu choices and Last menu selection for a menu level
declare choice[9]
declare wOldSel[9]
***** Setup variables
wlevel = 1 && First menu level
do OptSetup && Other variable setups
selection = 0
clr = .T. && Clear Screen Flag
do while .T. && Menu Loop
if clr
Title = 'Main Access Menu' && Clear Screen and place title at top
do lscrtop with Title
clr = .F.
endif
***** Setup Menu selections for Main Menu
choice[1] = 'Mailing List Maintenance'
choice[2] = 'Print Reports'
choice[3] = 'Reindex Files'
choice[9] = 'Exit Option Menu Demo' && 9 is always exit
do opt with choice, 3, wOldSel[wlevel], selection && Do menu selection
wOldSel[wlevel] = selection && Last selection always stored in array
***** Do appropriate action for menu selection
do case
case selection = 1
do MailMenu && Another demo menu
clr = .T. && Clear screen upon return
case selection = 2
do RepMenu && Another demo menu
clr = .T. && Clear screen upon return
case selection = 3
do OPTNDX && Fake program (doesn't do anything)
clr = .F. && Don't clear screen (was restored from a save screen)
case selection = 9 && QUIT
Question = "Are you sure you want to quit"
Answer = ""
do Ask_YN with Question, Answer && Ask if sure in pop up window
if (Answer $ 'Yy')
exit && Yes, then exit else do menu again
endif
clr = .F. && Don't clear screen
endcase
enddo (end of optdemo)
***** Done so clear screen and quit out of program
clear
? 'Normal Exit from '+stitle
?
?
return