Im new(ish) to this. I made a custom menu program. I want your feedback on how to optimize and anything I'm doing wrong so I can get better and share my latest work with the community. It was made to be used from separate programs. in that program you would set the names of the strings. String 1 is for the title of the menu, 2-7 are for the names of the menu elements. It's made on the home screen and it has a cool and simple animation based on what element your clicked on. It has a required back button, which could be modified to be shut off but I like it. Once the user presses the enter button It stores their choice in the variable C and return to the parent program where you can manipulate that program based on the users choice(C). I used Spaces to seperate the code and make it more readable for my sake. Make sure you leave nothing uncriticised. Make me cry. Maybe even use this in your own program. P.S. It uses a list called LMENUX with 7 elements.
:ClrHome : :2->Y // "->" represents the Sto> Key : :For(I,1,7) :2->LMENUX(I) :End : :Output(1,1,"----(16 -'s)---" // Cool Title Background : : While 1 :Output(1,int((16-length(Str1))/2+1,Str1 // To Center Menu Title :Output(2,LMENUX(1),Str2 // All the Menu Elements at their respective X co-ordinates :Output(3,LMENUX(2),Str3 :Output(4,LMENUX(3),Str4 :Output(5,LMENUX(4),Str5 :Output(6,LMENUX(5),Str6 :Output(7,LMENUX(6),Str7 :Output(8,LMENUX(7),"Back" :Output(Y,1,">" // Cursor :Y->T // To track whether Y Changes : :getKey->K :If K=25 // Movement of the Cursor Up and Down :Y-1->Y :If K=34 :Y+1->Y :If Y=1 :8->Y :If Y=9 :2->Y :If K=105 // User Presses ENTER Button inputs choice into C :Then :Y-1->C :Return :End : :3->LMENU(Y-1) // Moves Right the Item User is currently at :Output(Y,2," " : :If Y=/= T // =/= is does not equal. Checks if Y has Changed :Then :Output(T,1," " // Erases previous cursor :2->LMENU(T-1) // Moves previously highlighted Element Back to the Left :If T=2 :Output(T,length(Str2)+2," " // Erases Where the Last Letter of Previously Moved Element :If T=3 :Output(T,length(Str3)+2," " :If T=4 :Output(T,length(Str4)+2," " :If T=5 :Output(T,length(Str5)+2," " :If T=6 :Output(T,length(Str6)+2," " :If T=7 :Output(T,length(Str7)+2," " :If T=8 :Output(T,6," " :End :End
The Code Works well on the calculator(TI 84). If anything s seriously messed up that was error in inputting the code, but comment it anyways. I thank you for your time. feel free to use this wherever you would like.