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
omni


Member


Joined: 14 Jun 2003
Posts: 115

Posted: 27 Jul 2003 07:25:34 pm    Post subject:

when does a for( loop stop? Does it stop when the third argument is greater than or equal to the first variable, since it loops and increments. ie:

syntax:

for(variable,starting,end

and will anything within the loop execute if its like this:

for(X,1,1

?
Back to top
JesusFreak
JesusFreak


Active Member


Joined: 17 Jun 2003
Posts: 537

Posted: 27 Jul 2003 09:09:24 pm    Post subject:

you have to do
For(X,A,B //B has to be greater than A

so this would work
For(X,1,2
Code
End
Back to top
Darth Android
DragonOS Dev Team


Bandwidth Hog


Joined: 31 May 2003
Posts: 2104

Posted: 28 Jul 2003 02:44:55 am    Post subject:

JesusFreak wrote:
For(X,A,B //B has to be greater than A

wrong
u can do For(X,10,1,-1
and even For(X,10,1 will execute once
rule: all for loop will always execute once
here is how they work:
variables will be referred to like this: For(X,A,B[,C] (C is 1 if unspecified)
A->X
:loop
go through loop
X+C->X
if X>B, stop
else, goto loop
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

 

Advertisement