The problem seems to have been solved, thanks to KermMartian.

Thank you


In my prime factorization program I keep getting an error label (some of the code is attached).


I can't figure out what the check syntax option says is wrong, and i don't know enough to identify the error myself.

Here's the code:
(ₒ means store)

:ClrHome
:Disp "Prime Factorization"
:prgmPQPV
:Input "Number=",A
:AₒB
:ClrHome
:If A>0 or A=int(A)
:Then
:Goto 00
:End
:Lbl 00
:If (A/2)=int(A/2)
:Then
:(Z+1)ₒZ
:(A/2)ₒA
:Goto 00
:End
:If (A/2)≠int(A/2)
:Then
:Goto 01
:End
:Stop
:Lbl 01
:If (A/3)=int(A/3)
:Then
:(Y+1)ₒY
:(A/3)ₒA
:Goto 01
:End
:If (A/3)≠int(A/3)
:Then
:Goto 02
:End
:Stop
:Lbl 02
....It continues like this, just interchange 3 for an appropriate prime and go one letter down in the alphabet for variable.
Err: Label just means you have some kind of a goto command with a lable that does not exist.
I actually checked for that and couldn't find anything...
When you get the error message there should be two optionis, click the second one and se what it takes you to in the code then post that line.
I didn't get the second option, just an ERR:LABEL

And I'm looking through it now in case i managed to miss a label
Double check all of your labels and gotos
checked again...nothing I could see

(keep in mind, most of my programming knowledge has come from experimentation and the nice little explanation that the calculator itself possesses)
What's the code for prgmPQPV?
Can you PM me the full source?
prgmPQPV

My clearing program. It clears all of my variables. Mainly because I can and so certain programs don't get confused.



My calculator is incompatible with any computer I have access to...So all I have is what I've posted.

But the primes go up to 83 and then I have various outputs like this:

:Output(2,1,"2^"
:Output(2,4,Z

and then i go down to the 7th row and go over.
Remember, ERR:LABEL does not have a goto option, as mentioned in the security section of the BASIC-Dev.

Can I also see the source?

Defined in the manual, an ERR:LABEL occurs if, and only if, there is no Lbl with a corresponding Goto. Basically, there is a Goto <label name> w/o a Lbl <label name>.


Wait. What you posted is what you have, yet you have another program?
No no no, I posted what I have of this program on the computer (which I had to type in).

I'm relatively new at programming.

I've just checked all of the labels, which I'll do again in about 5 minutes.
I have an Idea. maybe you mistyped one of your labels of goto's I thk you might have mistyped one of you 0's as an O. In case you couldn't tell the first is a zero the second is the letter O.
looking through yet again...and I didn't switch any O's with 0's. That would mean extra keystrokes...


Is it my telling it to Goto X within Lbl X?


While I'm here:

couldn't I optimize this by getting rid of all of the stop commands and my
If (A/prime)doesn't equal int(A/prime)
Then
Goto next
End
1. Use http://sc.cemetech.net to generate code from your programs to post. It's easier for everyone. Smile
2. Never, never ever EVER Goto out of a Then/End structure. It causes memory leaks and slows down your program.
3. Always use Return instead of Stop for compatibility
4. I'm fairly sure massive optimization can be done to that. If no one else beats me to it, I'll optimize it later.
Not using the Goto within the loop doesnt seem to work. Or do I not even need goto's and label's in this at all?

My calculator and computer don't currently work together. I'm working on that too.

And you need to go and optimize it...I'm doing this to see if I can.

I am really a beginning programmer. I don't even know all of the commands or how to use them.
Ah, well, that's kinda key. Some random documentation we have here:
http://www.cemetech.net/projects/btutor/
http://www.cemetech.net/projects/basicelite/
http://www.ticalc.org/archives/files/fileinfo/369/36993.html

Other tutorials:
http://tifreakware.net/tutorials/83p/b/
Wow...it actually works now, thank you for listening and offering help.

I'll use those tutorials. Some structured education. That much I can handle.


Thank you very much.

(it looks like it was too long and a very confused program, now it's slightly less confused)
Post the code as you have it now? And please stick around for more help when you have questions; we're happy to assist. Smile
Oh, and the most complete TI-Basic tutorial site I have yet to come across: TI-Basic Developer
  
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 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