0 Members and 3 Guests are viewing this topic.
Okay, I'm kind of stuck now, I don't know if I should do a custom menu like this:[code]:AxesOff:ClrDraw:Text(1,1,"CHOOSE FORMULA:Text(7,1,"1:CIRCLE AREA:Text(14,1,"2:SPHERE VOL.:Text(21,1,"3:CYLINDER VOL.:Text(28,1,"4:CONE VOL.:Text(35,1,"5:CONE SURFACE AREA:Text(42,1,"6:QUADR. PYR. VOL.:Text(49,1,"7:CYLINDER SURFACE AREA:Text(56,1,"8:MORE FORMULAS:Repeat 2>abs(5-abs(5-abs(Ans-83:getKey:End:If Ans=92:Disp "CIRCLE AREA:If Ans=94:Disp "SPHERE VOL.:If Ans=82:Disp "CYLINDER VOL.:If Ans=83:Disp "CONE VOLUME:If Ans=84:Disp "CONE SURFACE AREA:If Ans=85:Disp "QUADR. PYR. VOLUME:If Ans=86:Disp "CYLINDER SURFACE AREA:Stop:If Ans=87::AxesOff:ClrDraw:Text(1,1,"CHOOSE FORMULA:Text(7,1,"1:SPHERE SURFACE AREA:Text(14,1,"2:CUBE VOL.:Text(21,1,"3:CUBE SURFACE AREA:Text(28,1,"4:PARALLELEPIPED VOL.:Text(35,1,"5:PARALLELEPIPED SURFACE AREA:Text(42,1,"6:TRAPEZIUM AREA:Text(49,1,"7:RECTANGLE AREA:Text(56,1,"8:MORE FORMULAS:Repeat 2>abs(5-abs(5-abs(Ans-83:getKey:End:If Ans=92:Disp "SPHERE SURFACE AREA:If Ans=94:Disp "CUBE VOLUME:If Ans=82:Disp "CUBE SURFACE AREA:If Ans=83:Disp "PARALLELEPIPED VOL.:If Ans=84:Disp "PARALLELEPIPED SURFACE AREA:If Ans=85:Disp "TRAPEZIUM AREA:If Ans=86:Disp "RECTANGLE AREA:If Ans=87:Disp "MORE FORMULAS"
:ClrHome:Menu("CHOOSE FORMULA","CIRCLE AREA",1,"SPHERE VOL.",2,"CYLINDER VOL.",3,"CONE VOL.",4,"QUADR PYR VOL.",5,"SPHERICAL SRFCE AREA",6,"MORE FORMULAS",7:Lbl 1:Prompt R:Output(4,2,"AREA IS:":Output(5,2,RRπ:Stop:Lbl 2:Prompt R:Output(4,2,"VOLUME IS:":Output(5,2,(4/3)πRRR:Stop:Lbl 3:Prompt R,H:Output(4,2,"VOLUME IS:":Output(5,2,RRπH:Stop:Lbl 4:Prompt R,H:Output(4,2,"VOLUME IS:":Output(5,2,(RRπH)/3:Stop:Lbl 5:Prompt L,H:Output(4,2,"VOLUME IS:":Output(5,2,LLH/3:Stop:Lbl 6:Prompt R:Output(4,2,"SURFCE AREA IS:":Output(5,2,4πRR:Lbl 7:Menu("CHOOSE FORMULA","CONE SURFACE AREA",1,"CYLINDER SURFACE AREA",2,"CUBE VOL.",3,"CUBE SURFACE AREA",4,"PARALLELEPIPED VOL.",5,"PARALLELEPIED SURF. AREA",6:Lbl 1:Disp "CONE SURFACE AREA"
On this one, the labels for the second menu are used as the ones in the first menu.Ideas? Thanks much
:ClrHome:Menu("CHOOSE FORMULA","CIRCLE AREA",1,"SPHERE VOL.",2,"CYLINDER VOL.",3,"CONE VOL.",4,"QUADR PYR VOL.",5,"SPHERICAL SRFCE AREA",6,"MORE FORMULAS",7:Lbl 1:Prompt R:Output(4,2,"AREA IS:":Output(5,2,RRπ:Stop:Lbl 2:Prompt R:Output(4,2,"VOLUME IS:":Output(5,2,(4/3)πRRR:Stop:Lbl 3:Prompt R,H:Output(4,2,"VOLUME IS:":Output(5,2,RRπH:Stop:Lbl 4:Prompt R,H:Output(4,2,"VOLUME IS:":Output(5,2,(RRπH)/3:Stop:Lbl 5:Prompt L,H:Output(4,2,"VOLUME IS:":Output(5,2,LLH/3:Stop:Lbl 6:Prompt R:Output(4,2,"SURFCE AREA IS:":Output(5,2,4πRR:Lbl 7:Menu("CHOOSE FORMULA","CONE SURFACE AREA",8,"CYLINDER SURFACE AREA",9,"CUBE VOL.",10,"CUBE SURFACE AREA",4,"PARALLELEPIPED VOL.",11,"PARALLELEPIED SURF. AREA",12:Lbl 8:Disp "TEST SUCCESS"
:AxesOff:ClrDraw:1→W:While W:While W=1:Text(1,1,"CHOOSE FORMULA:Text(7,1,"1:CIRCLE AREA:Text(14,1,"2:SPHERE VOL.:Text(21,1,"3:CYLINDER VOL.:Text(28,1,"4:CONE VOL.:Text(35,1,"5:CONE SURFACE AREA:Text(42,1,"6:QUADR. PYR. VOL.:Text(49,1,"7:CYLINDER SURFACE AREA:Text(56,1,"8:MORE FORMULAS:Repeat 2>abs(5-abs(5-abs(Ans-83:getKey:End:Ans→K:If K=73:Then:ClrDraw:2→W:Else:If K=92:Disp "CIRCLE AREA:If K=93:Disp "SPHERE VOL.:If K=94:Disp "CYLINDER VOL.:If K=82:Disp "CONE VOLUME:If K=83:Disp "CONE SURFACE AREA:If K=84:Disp "QUADR. PYR. VOLUME:If K=72:Disp "CYLINDER SURFACE AREA:Stop:End:End:While W=2:Text(1,1,"CHOOSE FORMULA:Text(7,1,"1:SPHERE SURFACE AREA:Text(14,1,"2:CUBE VOL.:Text(21,1,"3:CUBE SURFACE AREA:Text(28,1,"4:PARALLELEPIPED VOL.:Text(35,1,"5:PARALLELEPIPED SURFACE AREA:Text(42,1,"6:TRAPEZIUM AREA:Text(49,1,"7:RECTANGLE AREA:Text(56,1,"8:MORE FORMULAS:Repeat 2>abs(5-abs(5-abs(Ans-83:getKey:End:Ans→K:If K=73:Then:1→W:ClrDraw:Else:If K=92:Disp "SPHERE SURFACE AREA:If K=93:Disp "CUBE VOLUME:If K=94:Disp "CUBE SURFACE AREA:If K=82:Disp "PARALLELEPIPED VOL.:If K=83:Disp "PARALLELEPIPED SURFACE AREA:If K=84:Disp "TRAPEZIUM AREA:If K=72:Disp "RECTANGLE AREA:Stop:End:End:End
:If (Condition):Then:(Do Whatever):End
Try this code:Code: [Select]:AxesOff:ClrDraw:1→W:While W:While W=1:Text(1,1,"CHOOSE FORMULA:Text(7,1,"1:CIRCLE AREA:Text(14,1,"2:SPHERE VOL.:Text(21,1,"3:CYLINDER VOL.:Text(28,1,"4:CONE VOL.:Text(35,1,"5:CONE SURFACE AREA:Text(42,1,"6:QUADR. PYR. VOL.:Text(49,1,"7:CYLINDER SURFACE AREA:Text(56,1,"8:MORE FORMULAS:Repeat 2>abs(5-abs(5-abs(Ans-83:getKey:End:Ans→K:If K=73:Then:ClrDraw:2→W:Else:If K=92:Disp "CIRCLE AREA:If K=93:Disp "SPHERE VOL.:If K=94:Disp "CYLINDER VOL.:If K=82:Disp "CONE VOLUME:If K=83:Disp "CONE SURFACE AREA:If K=84:Disp "QUADR. PYR. VOLUME:If K=72:Disp "CYLINDER SURFACE AREA:Stop:End:End:While W=2:Text(1,1,"CHOOSE FORMULA:Text(7,1,"1:SPHERE SURFACE AREA:Text(14,1,"2:CUBE VOL.:Text(21,1,"3:CUBE SURFACE AREA:Text(28,1,"4:PARALLELEPIPED VOL.:Text(35,1,"5:PARALLELEPIPED SURFACE AREA:Text(42,1,"6:TRAPEZIUM AREA:Text(49,1,"7:RECTANGLE AREA:Text(56,1,"8:MORE FORMULAS:Repeat 2>abs(5-abs(5-abs(Ans-83:getKey:End:Ans→K:If K=73:Then:1→W:ClrDraw:Else:If K=92:Disp "SPHERE SURFACE AREA:If K=93:Disp "CUBE VOLUME:If K=94:Disp "CUBE SURFACE AREA:If K=82:Disp "PARALLELEPIPED VOL.:If K=83:Disp "PARALLELEPIPED SURFACE AREA:If K=84:Disp "TRAPEZIUM AREA:If K=72:Disp "RECTANGLE AREA:Stop:End:End:EndTo quit, press ON to break it. One of the main reasons the above code didn't work it because you had the wrong key-codes in your If statements. I didn't know if it was supposed to loop back or not, but you can change that or add in another While W= loop with more formulas. Another thing that went wrong was before the If that created the second menu you had your Stop statement, which would end program execution.If you want your If statements to do more than one thing, you'll need to use and If Then structure.Code: [Select]:If (Condition):Then:(Do Whatever):End
Oh my god, when I try to run it in a calculator, the result shows up fast and the program quits, instead of what happens in WabbitEmu...No idea why?
Quote from: ScoutDavid on October 31, 2010, 03:04:19 pmOh my god, when I try to run it in a calculator, the result shows up fast and the program quits, instead of what happens in WabbitEmu...No idea why?Try adding a Pause if you want the results to stay on the screen.Are you using a shell?