I am making a physics solver, and currently am working on making all of the menus for the program. However, when I go to the menu for conversions, and scroll all the way to the bottom the box starts to no longer line up with the number. It is only off by a pixel or two, but I would really like to fix it especially since it causes a domain error if I go to 8 selections instead of 7. I am sure its an error in the formulas I am using. Included below is a table of the variables I have used so far:
Variable | Purpose |
---|---|
Str1 | List of menu options |
N | Number of options in the current menu |
O | Menu identifier |
S | The current highlighted index of the menu |
L | The length of the substrings for the current menu |
J | Calculation Data |
H | Calculation Data |
F | Calculation Data |
K | Keystrokes |
Theta | For-Loop counter |
Z | For-Loop counter |
Xmin,Xmax | Graph Settings |
Ymin,Ymax | Graph Settings |
GDB1 | Graph Settings for cleanup |
StoreGDB 1
Lbl M0
ClrDraw
AxesOff
GridOff
ClrHome
62→Ymax
0→Ymin
94→Xmax
0→Xmin
0→O
1→S
13→L
"1:Kinematics 2:Conversions3:KinElectric "→Str1
3→N
Lbl M
Text(0,0,"Physics Solver Beta 0.1"
Horizontal Ymax-7
For(θ,0,N-1
Text(8+7θ,0,sub(Str1,1+Lθ,L)
End
Horizontal Ymax-9-7N
For(θ,6,1,⁻1
For(Z,0,4
Pxl-Change(8+7S-θ,Z
End
End
Repeat K=45 or K=105
Repeat sum(K={23,45,105,34,25
getKey→K
End
If (K=23)O:Goto M0
If (K=23)not(O:Goto E
If K=34(S<N) or K=25(S>1
Then
For(θ,6,1,⁻1
For(Z,0,4
Pxl-Change(8+7S-θ,Z
End
End
S+(K=34)-(K=25)→S
For(θ,1,6
For(Z,0,4
Pxl-Change(8+7S-θ,Z
End
End
End
End
ClrDraw
ClrHome
If K=45:Goto E
If (O=0)(S=1:Goto M1
If (O=0)(S=2:Goto M2
If (O=1)(S=6:Goto M3
If (O=1)(S=7:Goto M0
If (O=2)(S=1:Goto C1
If (O=2)(S=2:Goto C2
If (O=2)(S=3:Goto C3
If (O=2)(S=4:Goto C4
If (O=2)(S=5:Goto C5
If (O=2)(S=6:Goto M0
If (O=3)(S=5:Goto M1
Lbl E
ClrDraw
RecallGDB 1
ClrHome
Return
Lbl M2
"1:Kilograms◄ ►Lbs 2:Meters◄ ►Feet 3:ElectronVolt◄ ►Joule4:Joule◄ ►Calorie 5:Horsepower◄ ►Watt 6:Back →Str1
2→O:1→S:22→L:6→N
Goto M
Lbl CA
If H:Disp FH
If J:Disp J/F
Pause
Goto M2
Lbl C1
Input "Kg: ",H
Input "Lbs: ",J
2.2→F
Goto CA
Lbl C2
Input "Meters: ",H
Input "Feet:",J
3.2→F
Goto CA
Lbl C3
Input "eV: ",H
Input "Joule: ",J
1.60218ᴇ⁻19→F
Goto CA
Lbl C4
Input "Joule: ",H
Input "Calorie: ",J
.239→F
Goto CA
Lbl C5
Input "Hp: ",H
Input "Watt: ",J
745.7→F
Goto CA
Lbl M1
"1:U,V,A2:U,V,D3:U,V,T4:U,A,D5:U,A,T6:More 7:Back →Str1
1→O:1→S:7→L:7→N
Goto M
Lbl M3
"1:U,D,T2:V,A,T3:V,D,T4:A,D,T5:Back →Str1
3→O:1→S:7→L:5→N
Goto M
Edit: Updated Code