Re: A BUG in 4GL ??
Posted in 1992
In article <9063@emory.mathcs.emory.edu> jbaker@lexington-emh2.army.mil ("John Baker, Lex-Blue Grass Army Depot") writes: Asking if there are any bugs in the 4gl code he included: >database sfbase >MAIN > define msel char(1) # <--- the user's menu selection. > defer interrupt > options input wrap > >open form rp_men from "tkw2" > >label dsf: > display form rp_men # <--- Display the menu form. > options prompt line 15, message line 15 > > while true > prompt " Enter selection and press Return: " > for char msel > if msel not matches "[1-4]" then > display msel, " is not a valid option. Try again." at 15,25 > sleep 4 > end if > end while > > case msel > when "1" > clear screen > # call rp_qry() <--- this function not yet coded. > when "2" > message " Option 2, not yet implemented." attribute (reverse) > sleep 4 > message "" > when "3" > message " Option 3, not yet implemented." attribute (reverse) > sleep 4 > message "" > when "4" > clear screen > exit program > otherwise > display msel, " is not a valid option." at 15,25 > sleep 3 > end case >goto dsf >END MAIN >- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - main define ... open form ... while true display form ... options prompte line ... while true prompt " Enter selection and press Return: " for char msel if msel not matches "[1-4]" then display msel, " is not a valid option. Try again." at 15,25 sleep 4 end if end while case msel ... ... end case end while end main This should loop in the way you seem to want, judging by your GOTO lines. The program exit is still in your CASE statement. You do not have a WHILE nested in a CASE; you do have a WHILE nested in a WHILE, but no EXIT WHILE is needed at eitehr level. I have NOT run this, but it should work. 8-) Steve -- Steve Price UNIX: pacbell!pbhyf!rsprice PHONE: (510)823-1951 Progress is an illusion.