Am I just really dumb?
yes
 50%  [ 1 ]
yes, but with more words
 50%  [ 1 ]
Total Votes : 2

Hopefully this question will be extremely easy to answer and will make me look like an idiot in asking it.

I'm attempted to utilize a code from the internet (whooshing noises inserted here) to use menus in a similar way to ones already on the calculator (i.e. the PGRM menu and its 3 sub-menus at the top); and that's all fine and great, but I'm having difficulty understanding how to add content to each "page" (so to speak-- I don't know what the technical jargon is for it).

Here is the code that I am going off of:


Code:
3->A
"[MAIN] OPT1 OPT2"->Str1
"MAIN [OPT1] OPT2"->Str2
"MAIN OPT1 [OPT2]"->Str3



1->B
While 1
   If B=1:Str1
   If B=2:Str2
   If B=3:Str3
   ClrHome
   Output(1,1,Ans
   length(Ans)/16
   If fPart(Ans
   1+iPart(Ans
   Ans->D
   2->X
   Repeat C=24 or C=26
      Output(X,2,">
      Repeat Ans
         getKey->C
      End
      If Ans=21
      Then
         X-1->X
         Return
      End
      Output(X,2," "
      X-(Ans=25)+(Ans=34->X
      2(X>D)+D(X<=1)+X(X<=D and X>1->X
      max(1,min(A,B+(C=26)-(C=24->B
   End
End


EDIT: code credit to Mr Dino @ http://tibasicdev.wikidot.com

Link to the code

EDIT #2:
i don't like using the normal menus and need to be a special snowflake, ok
im just trying to make a really intense calculus program so I don't have to do anything myself ever again
Personally I'm not completely advanced in BASIC enough to understand what that code does. However, I was pretty annoyed at how the menu( token looks so I came up with my own and have been using it ever since.

Code:
Repeat Y=105
   Output(N,1," "
   If Y=34:N+1->N
   If Y=25:N-1->N
   If N=2:O+2->N
   If N=O+3:3->N
   Output(N,1,"[|>]
   getKey->Y
End


O is equal to the number of selections you want possible. To add options, simply put Output(2,[line],"what you want"
The top line is reserved for a title and the second can be a spacer (I usually just put a line of ====)
I hope this helps
Well, you can't do a multi-menu menu like the prgm menu, in which you press left and right to cycle through "pages". You can, however, make a Page menu that has different pages, like this, and have the pages be separate menus.


Code:
Lbl MM
Menu("PAGE MENU","Page 1",P1,"Page 2",P2,...

Lbl P1
Menu for P1 functions, or do stuff
Goto MM
//returns to the main menu

Lbl P2
Menu for P2 functions, or do stuff
Goto MM
//returns to the main menu


NOTE: "//" is SC notation (and some other programming language notations for a comment. This will not work on the calc, you need a Double quote " for a comment (read: Speed consuming string))
SM84CE wrote:
Well, you can't do a multi-menu menu like the prgm menu, in which you press left and right to cycle through "pages". You can, however, make a Page menu that has different pages, like this, and have the pages be separate menus.


Code:
Lbl MM
Menu("PAGE MENU","Page 1",P1,"Page 2",P2,...

Lbl P1
Menu for P1 functions, or do stuff
Goto MM
//returns to the main menu

Lbl P2
Menu for P2 functions, or do stuff
Goto MM
//returns to the main menu


NOTE: "//" is SC notation (and some other programming language notations for a comment. This will not work on the calc, you need a Double quote " for a comment (read: Speed consuming string))


So I understand that the base language of the calculator is different from the language available in the program function, but is there a specific reason why you can't have menus similar to the program menu that scroll side to side?
If you load that code into the emulator they have on here (as well as when I put it into my calculator), it allows you to scroll through the top values in the way I would like, but I just don't know how to add content in the remaining space?????????? Maybe I'm just an idiot idk....

Thank you for your help.

edit: specifically, I just want a way to cycle through menus without them being nested inside of other menus
Here you go - I put this together in about 15-20 minutes, I think it is what you are looking for. Your options can be whatever you want, so long as they don't exceed the edge of the screen. Your menu/page names can also be whatever they want so long as they can all fit on the screen, but you will have to adjust the "5" in "5A+1" to accommodate the length of any new menu text.

Here's a little preview:


Please try and learn from this code! I will do my best to explain it:

Code:

DelVar K~1->A
{2,3,2,4->L1
Repeat sum(K={45,105
   If A=~1 or sum(K={24,26
   Then
      If A=~1:0->A
      ClrHome
      Output(1,1," PG1  PG2  PG3  PG4
      Output(1,5A+1,"[
      Output(1,5A+5,"]
      2->B
      If A=0
      Then
         Output(2,2,"1:THINGIE1
         Output(3,2,"2:THINGIE2
      End
      If A=1
      Then
         Output(2,2,"1:THIS1
         Output(3,2,"2:THIS2
         Output(4,2,"3:THIS3
      End
      If A=2
      Then
         Output(2,2,"1:PROGAA
         Output(3,2,"2:PROGBB
      End
      If A=3
      Then
         Output(2,2,"1:HELLOWORLD
         Output(3,2,"2:BOXMOVE
         Output(4,2,"3:GUESSER
         Output(5,2,"4:BASICNOTECE
      End
   End
   Output(B,1,">
   Repeat Ans
      getKey
   End
   Ans->K
   A+(A<3)(Ans=26)-(A>0)(Ans=24->A
   If sum(K={25,34
   Then
      Output(B,1," "
      B-(K=25)(B>2)+(K=34)(B<1+L1(A+1->B
   End
End
ClrHome
If K=105
Disp "PG"+toString(A+1)+" OPTION "+toString(B-1

//Copyright (c) 2018 Michael Baker


So, in this program you can use the arrow keys to get left and right between the different pages/menus, and you can go up/down in that pages' list. The first thing I do in the program is store the list L1, which simply states how many options are on each page. I use this to make sure you can't scroll further down than there are options.

You can exit the program by hitting [clear] or select an option, which will print back to you the unique menu option you chose, which is stored in variable A (the page) and variable B (the option number on the page). From there, you can use if conditionals based on A and B to execute specific code.
Michael2_3B wrote:
Here you go - I put this together in about 15-20 minutes, I think it is what you are looking for. Your options can be whatever you want, so long as they don't exceed the edge of the screen. Your menu/page names can also be whatever they want so long as they can all fit on the screen, but you will have to adjust the "5" in "5A+1" to accommodate the length of any new menu text.

Here's a little preview:


Please try and learn from this code! I will do my best to explain it:

Code:

DelVar K~1->A
{2,3,2,4->L1
Repeat sum(K={45,105
   If A=~1 or sum(K={24,26
   Then
      If A=~1:0->A
      ClrHome
      Output(1,1," PG1  PG2  PG3  PG4
      Output(1,5A+1,"[
      Output(1,5A+5,"]
      2->B
      If A=0
      Then
         Output(2,2,"1:THINGIE1
         Output(3,2,"2:THINGIE2
      End
      If A=1
      Then
         Output(2,2,"1:THIS1
         Output(3,2,"2:THIS2
         Output(4,2,"3:THIS3
      End
      If A=2
      Then
         Output(2,2,"1:PROGAA
         Output(3,2,"2:PROGBB
      End
      If A=3
      Then
         Output(2,2,"1:HELLOWORLD
         Output(3,2,"2:BOXMOVE
         Output(4,2,"3:GUESSER
         Output(5,2,"4:BASICNOTECE
      End
   End
   Output(B,1,">
   Repeat Ans
      getKey
   End
   Ans->K
   A+(A<3)(Ans=26)-(A>0)(Ans=24->A
   If sum(K={25,34
   Then
      Output(B,1," "
      B-(K=25)(B>2)+(K=34)(B<1+L1(A+1->B
   End
End
ClrHome
If K=105
Disp "PG"+toString(A+1)+" OPTION "+toString(B-1

//Copyright (c) 2018 Michael Baker


So, in this program you can use the arrow keys to get left and right between the different pages/menus, and you can go up/down in that pages' list. The first thing I do in the program is store the list L1, which simply states how many options are on each page. I use this to make sure you can't scroll further down than there are options.

You can exit the program by hitting [clear] or select an option, which will print back to you the unique menu option you chose, which is stored in variable A (the page) and variable B (the option number on the page). From there, you can use if conditionals based on A and B to execute specific code.



!!!!!!!!!!!!!!!!!!!!!!!!!!!
THIS
!!!!!!!!!!!!!!!!!!!!!!!!!!!
THIS IS EXACTLY WHAT I NEEDED THANK YOU SO MUCH!!
I especially appreciate the explanation! I always like to know how things work. Wow, 15-20 minutes... you are either crazy intuitive or have extensive knowledge (great power ft. great responsibility) :000
I don't know how incredibly much to express my gratitude right now but I have to go to sleep for now... THANK YOU SO MUCH AGAIN!!!
  
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 1 of 1
» 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