21tmccauley wrote:
I would like to make an option on the menu to quit the program using a Lbl. How would I do this? Is there a quit command somewhere? Thanks in advance.


You can do this:

Code:
Menu("TITLE",ITEM,lbl,"QUIT",Q

...code...

Lbl Q
ClrHome
Stop
Don't use Stop, if you will have stuff after the Quit Lbl, use Return. If not, just end there, no Stop or Return needed. Using Stop makes it error with Cesium./me
SM84CE wrote:
Don't use Stop, if you will have stuff after the Quit Lbl, use Return. If not, just end there, no Stop or Return needed. Using Stop makes it error with Cesium./me


I think that c4000 suggested putting The quit label at the end of the program, so that's what I said.
c4ooo wrote:
Create a new menu item with your label name, then put that Lbl at either the very end of your program, or place the 'Return' or 'Halt' commands after the Lbl.

Thanks!
I have decided to remake this program using the new skills I have learned. I started out with a menu screen. On it, it flashes "press enter". The problem is it will only let the user press enter during the small amount of time "press enter" isn't on the screen, and that is very annoying. How would I prevent this?

Code:

ClrHome
Repeat G=105
   getKey->G
   Output(2,2,"------------------------
   Output(4,8,"Welcome to
   Output(5,11,"A OR V
   Output(6,6,"By Tate McCauley
   Output(9,2,"-----------------------
   Output(8,8,"Press Enter
   Wait 1
   Output(8,1,"                           
End
ClrHome
21tmccauley wrote:
I have decided to remake this program using the new skills I have learned. I started out with a menu screen. On it, it flashes "press enter". The problem is it will only let the user press enter during the small amount of time "press enter" isn't on the screen, and that is very annoying. How would I prevent this?

Code:

ClrHome
Repeat G=105
   getKey->G
   Output(2,2,"------------------------
   Output(4,8,"Welcome to
   Output(5,11,"A OR V
   Output(6,6,"By Tate McCauley
   Output(9,2,"-----------------------
   Output(8,8,"Press Enter
   Wait 1
   Output(8,1,"                           
End
ClrHome




You can do: (try this)


Code:

ClrHome
   Output(2,2,"------------------------
   Output(4,8,"Welcome to
   Output(5,11,"A OR V
   Output(6,6,"By Tate McCauley
   Output(9,2,"-----------------------
   Repeat K=105
   getKey->K //I personally use K, but G is fine
   Output(8,8,"Press Enter
   Wait 1
   Output(8,1,"                           
End
ClrHome
jcgter777 wrote:
21tmccauley wrote:
I have decided to remake this program using the new skills I have learned. I started out with a menu screen. On it, it flashes "press enter". The problem is it will only let the user press enter during the small amount of time "press enter" isn't on the screen, and that is very annoying. How would I prevent this?

Code:

ClrHome
Repeat G=105
   getKey->G
   Output(2,2,"------------------------
   Output(4,8,"Welcome to
   Output(5,11,"A OR V
   Output(6,6,"By Tate McCauley
   Output(9,2,"-----------------------
   Output(8,8,"Press Enter
   Wait 1
   Output(8,1,"                           
End
ClrHome




You can do: (try this)


Code:

ClrHome
   Output(2,2,"------------------------
   Output(4,8,"Welcome to
   Output(5,11,"A OR V
   Output(6,6,"By Tate McCauley
   Output(9,2,"-----------------------
   Repeat K=105
   getKey->K //I personally use K, but G is fine
   Output(8,8,"Press Enter
   Wait 1
   Output(8,1,"                           
End
ClrHome

Thanks for the help. K does make more sense now that I think about it. Also, can you have the formula for a Nth-gon inside of the program?
21tmccauley wrote:
Also, can you have the formula for a Nth-gon inside of the program?


What do you mean? The formula for the area of a polygon?
This should explain what I want to do:
https://www.mathopenref.com/polygonregulararea.html
21tmccauley wrote:
This should explain what I want to do:
https://www.mathopenref.com/polygonregulararea.html


Then of course. Just maybe add a Label, and prompt starting values, and use those values in a formula which you can store to a variable.
How would you use output to display some options for shapes, and then wait until the user chooses one?
I tried this but it goes through like it wasn't there.

Code:

If Z=1
Goto B
If Z=2
Goto C

Lbl B
11->Z
While Z=11
   ClrHome
   Output(1,1,"Triangle (1)
// D
   Output(2,1,"Square (2)
// E
   Output(3,1,"Trapiziod (3)
// F
   Output(4,1,"Circle (4)
// G
   Output(5,1,"Rectangle (5)
// H
   Output(6,1,"Elipse (6)
// I
   Output(7,1,"Back (7)
// A
   Prompt Z
End
If Z=1
Goto D
If Z=2
Goto E
If Z=3
Goto F
If Z=4
Goto G
If Z=5
Goto H
If Z=6
Goto I
If Z=7
Goto A
Prompt doesnt take into account the Outputs. If you had 2 Output( commands, do Disp "","" (2 empty lines, remove the closing quote) to make the prompt appear on the 3rd line. I think this is what you are wondering/ asking about...

Try this:

21tmccauley, code fixed by SM84CE wrote:
How would you use output to display some options for shapes, and then wait until the user chooses one?
I tried this but it goes through like it wasn't there.

Code:

If Z=1
Goto B
If Z=2
Goto C

Lbl B
11->Z
Disp "","","","","","","
//7 empty lines
While Z=11
   ClrHome
   Output(1,1,"Triangle (1)
// D
   Output(2,1,"Square (2)
// E
   Output(3,1,"Trapiziod (3)
// F
   Output(4,1,"Circle (4)
// G
   Output(5,1,"Rectangle (5)
// H
   Output(6,1,"Elipse (6)
// I
   Output(7,1,"Back (7)
// A
   Prompt Z
End
If Z=1
Goto D
If Z=2
Goto E
If Z=3
Goto F
If Z=4
Goto G
If Z=5
Goto H
If Z=6
Goto I
If Z=7
Goto A
Here’s that code as a Menu( command, and then that code as a custom menu:


Code:

If Z=1
Goto B
If Z=2
Goto C

Lbl B
11->Z
Menu("Select a shape.","Triangle",D,"Square",E,"Trapezoid",F,"Circle",G,"Rectangle",H,"Ellipse",I,"Back",A


For the record, uppercase letters are much smaller byte-wise and probably faster.

Custom menu:


Code:

If Z=1
Goto B
If Z=2
Goto C

Lbl B
1->Z
While K<=34
   ClrHome
   Output(Z,1,">
   Output(1,2,"Triangle (1)
// D
   Output(2,2,"Square (2)
// E
   Output(3,2,"Trapezoid (3)
// F
   Output(4,2,"Circle (4)
// G
   Output(5,2,"Rectangle (5)
// H
   Output(6,2,"Ellipse (6)
// I
   Output(7,2,"Back (7)
// A
   Repeat Ans
      getKey
   End
   Ans-24->K
   // one space v
        Output(Z,1,"
   Z+(K=1)-(K=10->Z
   Z(Z<=7)+7(Z<1->Z
End
K+24->K
If Z=1 or K=92
Goto D
If Z=2 or K=93
Goto E
If Z=3 or K=94
Goto F
If Z=4 or K=82
Goto G
If Z=5 or K=83
Goto H
If Z=6 or K=84
Goto I
If Z=7 or K=85
Goto A


I'm like 99% sure the custom menu works, but I never tested it.
This is the formula for the area of a dodecahedron : (V=15+7√5)4*A^3. Would this work in my program?

Code:

((15+7sqrt(5)/4)(AAA)->X
21tmccauley wrote:
This is the formula for the area of a dodecahedron : (V=15+7√5)4*A^3. Would this work in my program?

Code:

((15+7sqrt(5)/4)(AAA)->X

Do:

Code:
Prompt A
(15+7√5)4*A^3->V
Disp V
Pause
Or

Code:

Prompt A
Pause (15+7√5)4*A^3
Ans -> X //if you want to store the answer

Very Happy
Or,
Code:
Input A
code
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement