proc menudecision
getch (menuselect)
if menuselect = "a" or menuselect = "A" then
selectiona
elsif menuselect = "b" or menuselect = "B" then
selectionb
elsif menuselect = "c" or menuselect = "C" then
selectionc
elsif menuselect = "d" or menuselect = "D" then
selectiond
elsif menuselect = "e" or menuselect = "E" then
selectione
elsif menuselect = "f" or menuselect = "F" then
selectionf
elsif menuselect = "g" or menuselect = "G" then
selectiong
elsif menuselect = "h" or menuselect = "H" then
selectionh
elsif menuselect = "i" or menuselect = "I" then
selectioni
elsif menuselect = "j" or menuselect = "J" then
selectionj
else
cls
Draw.Text ("The selection you have made is incorrect", 200, 200, system10, white)
Draw.Text ("Select either A, B, C, D, E, F, G, H, I, or J", 200, 180, system10, white)
Draw.Text ("Press any key to return to menu...", 200, 160, system10, white)
getch (anykey)
menudraw /* <-- how to get to menudraw if it's not declared yet?*/
end if
end menudecision
proc menudraw
colourback (blue)
cls
Draw.Text ("Select a menu item", 5, 5, arial12bold, white)
Draw.Text ("A. Perimeter calculator for circles", 200, 350, arial10, white)
Draw.Text ("B. Perimeter calculator for traingles", 200, 330, arial10, white)
Draw.Text ("C. Perimeter calculator for rectangles", 200, 310, arial10, white)
Draw.Text ("D. Area calculator for circles", 200, 290, arial10, white)
Draw.Text ("E. Area calculator for triangles", 200, 270, arial10, white)
Draw.Text ("F. Area calculator for rectangles", 200, 250, arial10, white)
Draw.Text ("G. Surface area calculator for cylinders", 200, 230, arial10, white)
Draw.Text ("H. Volume calculator for a sphere", 200, 210, arial10, white)
Draw.Text ("I. Volume calculator for a cylinder", 206, 190, arial10, white)
Draw.Text ("J. Quit", 206, 170, arial10, white)
menudecision
end menudraw |