I was trying to make a program that counts down to the end of class
and ultimately counts down to the end of school…
when i tried running it, i get an ERR:LABEL
.. i looked through my program and found no undefined label anywhere
then, i decided to track the error using the PAUSE command… and it lead me to
an IF command for some reason… and i made a separate program to test the same line of code..
and nothing was wrong with the IF command… am i going crazy?
this is annoying me because i spent the whole day on this program
|
We're glad you came by, but you might find what you're looking for elsewhere. TI-Basic Developer is not the site it once was. While its information on commands and other calculator features remains almost second-to-none, its forum, archives, and even hosting service, Wikidot, have been decaying for years. The calculator community would love to see what you're working on, or help you in your next coding adventure, but TI-Basic Developer is no longer the place to do it. Instead, you should head over to Cemetech (primarily American) or TI-Planet (primarily international). Both are active, well-established forums with their own archives, chatrooms, reference material, and abundant coding tools and resources. We'll see you there, we hope. |
Could we see the code? Or could you please explain it more.
This sounds like something I'd like to have. It hasn't happened yet this year, but I know the day will come before long where the school day takes forever. This program will help remind me that school isn't a decade long on those days. :)
I'd be interested to have it when it's done.
would you want the whole code? i can just upload it
but if you want to see it on the computer, i'll notepad it
Here's a part of my code
Lbl 1
L2(1)->H
L2(2)->M
L2(3)->S
L3(1)->K
L3(2)->A
L3(3)->T
if H<K:Then
Display "MINUTES",60-M+A
goto 1
end
The IF command was the problem area.. i put the pause command right after L3(3)->T
and the PAUSE still went through.
but when i put the PAUSE inside the IF command (Before Goto 1, of course)
the PAUSE didn't go through.
that means the entire IF command isn't working or is incorrect, right?
Use this http://www.cemetech.net/projects/basicelite/sourcecoder2.php
Then you dont have to type it out just copy and paste
Edit: Can you tell me what the lists are doing?
I posted what i think is the problem area in the previous post
but if the whole code is more useful:
:2→X
:Goto 13
:Lbl 14
:{8,50,0}→L3
:Goto 1
:Lbl 3
:{9,45,00}→L3
:Goto 1
:Lbl 4
:{10,0,0}→L3
:Goto 1
:Lbl 5
:{10,55,0}→L3
:Goto 1
:Lbl 6
:{11,50,0}→L3
:Goto 1
:Lbl 7
:{12,45,0}→L3
:Goto 1
:Lbl 8
:{1,40,0}→L3
:Goto 1
:Lbl 9
:ClrHome
:Output(3,1,"CONGRATULATIONS")
:Output(4,2,"ANOTHER DAY")
:Output(6,4,"SURVIVED")
:Pause
:Stop
:Lbl 1
:getTime→L2
:L2(1)→H
:L2(2)→M
:L2(3)→S
:L3(1)→K
:L3(2)→A
:L3(3)→T
:If H<K:Then
:Disp "MINUTES",60-M+A
:Goto 1
:End
:If H=K and M<A:Then
:Disp "MINUTES.",A-M
:Goto 1
:End
:If H=K and M+1=A:Then
:Disp "SECONDS",56-S
:Goto 1
:End
:If H=K and M=A:Then
:ClrHome
:Output(4,3,"TIME TO GO")
:Pause
:X+1→X
:End
:Goto X
:Lbl 13
:ClrHome
:Output(3,3,"COUNTDOWN")
:Output(4,2,"BY CHESTER MOY")
:Pause
:ClrHome
:Goto 14
Look at the goto X theres your error.
btw you dont need to close quotes and parentheses
really? but the program gets the error before it even gets to the Goto X
the PAUSE command works up until right after the first IF command
.. or is that a bad way to track errors?
The pause command will not be reached if you put it inside the if statement and the if statement is false.
That is where the pause bug tracking method fails, and you cannot use variables to goto.
ie, if you try to goto x and x = 4, it will search for lbl x and not lbl 4
dang it.. i thought i was being efficient….
so there's no other way to do it other than a whole lot of IF statements?
or are there other more useful commands i don't know?
also, before i used something like
:If H=K and M<A and M+1(NOTEQUAL)A:Then
i got an error for that, is this incorrect syntax?
I think the easiest way to get around the problem is to just use control loops instead of gotos. I almost never use them, because they just
make code more confusing, and if I learn a language that doesn't have gotos, and I wasn't already used to not using them, it would take some
time to adjust. I mean, by all means, If it's a lot more space efficient, and it's only a handful, go ahead and use those gotos, but otherwise,
I'd reccomend not using them.
uhuu, labels are really usefull sometimes
i made a snake game whit seven nested loops. keeping track of what "end" ends what is a nightmare
Actually you should probably minimize usage of gotos. its just good coding practice.
yeah, I know about those "nightmares", but It gets a lot easier.
Plus, What I do is start with 0 at the top of my program and whenever I see something that starts a loop, I add 1 to the number in my head.
If I see end, I subtract 1.
If at the end, I come out with 0, It worked.
If not, PROBLEM.
I agree. some adventure games are much easier to program in gotos and labels rather than using a hierarchic system with numerous loops and exiting conditions.. In my roller coaster tycoon game on ticalc I had to have places with more than 7 or 8 end commands and I gave up improving it because I completely lost track of how many end commands I needed after each loop.
I don't know how to use any command other than goto
but it seems to work for me
but, i have one more question
i just downloaded the TI Graph link software, and they only have it for TI-83 calculators
when i import the program, the getTime command shows up as some sort of r character.
i'm assuming because TI-83 calculators don't have that function.
also, when i manually type in getTime and save it, my calculator doesn't recognize it,
and in edit the getTime does not show up as one command, but instead it shows up as multiple characters
is there anyway i can get a hold of Graph Link for TI-84?
Use what I referred to in an earlier post http://www.cemetech.net/projects/basicelite/sourcecoder2.php
It has support for ti-84 files.Btw look through this website for how to use other commands besides goto.
Edit:btw heres an announcement to tell you not to use gotos http://www.unitedti.org/index.php?showtopic=8144
awesome!.. thanks!
i shall pass on this knowledge =]
but i'll still be keeping an eye out for a TI Graph Link that is compatible!
There is. I use the ticonnect programedit which TI for some reason removed from later versions. It supports Ti84's time commands and has a nice big window to write in. If you look around on google or something shouldn't be difficult finding it (last time i checked which is not long ago someone on another ti basic related forum has it zipped and uploaded, can't remember which forum though).
You cant type commands directly into the prgms on the GCs since its "remembered" in the form of tokens. It's not just for the time commands, same goes for things like If, For(, Output, etcetc. Time commands can only be accessed through catalog (i'm sure this was mentioned on the section in the wiki, read it like i did!). ([2nd],[0])