This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
Author Message


Joined: 09 Jan 2010
Posts: 12

Posted: 19 Mar 2010 12:51:02 pm    Post subject:

Hi there everyone,

I was playing with some code and I ended up with two pieces of code in a program.
Both were part of a Repeat loop. So I wanted to try something out. It works so far, however, I don't know whether this will mess things up later on.

What I have, not the actual code, but a simple rendition of it:

If not(Ans
Repeat A=B
If 0<Ans
Repeat A=C

Is this an effective way to do something that's written the same way, in two loops? Or would this bring errors?

Last edited by Guest on 21 Jun 2010 11:39:53 pm; edited 1 time in total
Back to top


Joined: 22 Jan 2007
Posts: 770

Posted: 19 Mar 2010 03:05:56 pm    Post subject:

This is actually not a good idea. It will screw up the Basic parser if it tries to skip over this bit of code, because the number of Repeats and Ends don't match.
Back to top


Joined: 09 Jan 2010
Posts: 12

Posted: 19 Mar 2010 04:40:33 pm    Post subject:

Ah, I see. Well back to typing again then. Thanks for the answer.
Back to top


Joined: 09 Aug 2009
Posts: 207

Posted: 19 Mar 2010 06:40:14 pm    Post subject:

The BASIC parser can be strange (or fun, if that's what you think) like that. One of my favorite examples: (this is not an original idea, I am sure that this has been mentioned elsewhere)

If X
Goto S
Lbl S

This is about the closest one can get to a subroutine. (I say subroutine, not function, for various reasons)
Back to top
Authentic INTJ

Super Elite (Last Title)

Joined: 25 Nov 2004
Posts: 3976

Posted: 19 Mar 2010 08:06:02 pm    Post subject:

Repeat A=Bnot(Ans)+C(0<Ans

Again, a simple rendition, as Ans will likely need to be preserved better.

Should Ans always remain in the positives:

Repeat A=Bnot(Ans)+Cnot(not(Ans


Repeat A=C+(B-C)not(Ans

The two being of equal size, we should now test which one is faster:


expr = A=Bnot(Ans)+Cnot(not(Ans
116 seconds

expr = A=C+(B-C)not(Ans
121 seconds

Last edited by Guest on 21 Jun 2010 08:55:57 pm; edited 1 time in total
Back to top
Display posts from previous:   
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
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours