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.

TI-Basic => TI-BASIC
Author Message
john massey

Joined: 26 Jul 2009
Posts: 50

 Posted: 23 Dec 2009 09:33:51 am    Post subject: If you had a normal "list" in a For statement such as For(I,1,16. and if you displayed the value of I for each loop it would display 1 2 3 4 5.... I have an idea which I am unable to get running. I have a list called OVER. I want to insert into OVER a"0" in places where I do not want to run code in my program. For example OVER might contain 1,0,3,0,5.. NOTE HERE In the code after my For statement I and after the code I need from you, I have statements like this: {6,32,8,9,10,3,12,16,6,4,42,7,8,6,7,11}→⌊FN002 Looking at NOTE HERE I want to use the "6" in ⌊FN002 but not the "32" because there is a "0" in OVER. Similarly the"8" but not the "9" The first thing I tried was: If OVER(I)=0 I+1=I That does not work.
thepenguin77

Joined: 17 Jul 2009
Posts: 72

 Posted: 23 Dec 2009 09:54:18 am    Post subject: You were close on what to do. If OVER(I)=0 End Or to optimize: If not(Over(I End This just loops if the number at I is 0.
john massey

Joined: 26 Jul 2009
Posts: 50

 Posted: 23 Dec 2009 10:51:27 am    Post subject: I would like you to consider the fact that there is a lot of code after your end statement. It is my view that with the end statement the remaining code in the program will not run. What say you?
thepenguin77

Joined: 17 Jul 2009
Posts: 72

 Posted: 23 Dec 2009 11:54:39 am    Post subject: The End statement only gets acknowledged if the If statement is true. So if the If is not true it skips the End and runs the rest of your program.
Graphmastur

Joined: 25 Mar 2009
Posts: 360

 Posted: 23 Dec 2009 12:24:51 pm    Post subject: If you just don't want to acknowledge certain results, and since I know your project, and can therefore understand that, then you would need to do like thepenguin77 said, except instead of doing end after that, you need to do this: For(I,1,16 If Over(I):Then // Code to check goes here. End That way, if Over(I)=0, your code won't run.
john massey

Joined: 26 Jul 2009
Posts: 50

 Posted: 23 Dec 2009 05:04:02 pm    Post subject: I am at my daughters for christmas. Without my computer with TI connect. I will test and respond when I get home.
Bhaliar

Member

Joined: 16 Nov 2009
Posts: 221

 Posted: 26 Dec 2009 01:48:01 am    Post subject: I'd like to point out that an end code is merely there to stop conditionals. If the conditional is true and coded one way, it will do everything between the conditional and the End, then continue on. If not it goes to the end and continues.
john massey

Joined: 26 Jul 2009
Posts: 50

 Posted: 26 Dec 2009 11:25:53 am    Post subject: I already have an "end" at the end of my program. Do I add another?
Graphmastur

Joined: 25 Mar 2009
Posts: 360

 Posted: 26 Dec 2009 06:55:29 pm    Post subject: Please show us your code.
Weregoose
Authentic INTJ

Super Elite (Last Title)

Joined: 25 Nov 2004
Posts: 3976

 Posted: 27 Dec 2009 11:29:36 am    Post subject: A block which uses an End and is arbitrarily placed within the confines of another block would look like this: :While A≠Z :code goes here :Repeat M=N :code goes here :End :code goes here :End If you have an End-able section at the tail end of the inside of another section, then two adjacent End's are necessary: :Repeat N=1 :code goes here :For(X,1,2 :code goes here :End :End :While I>10 :code goes here :If K=21 :Then :code goes here :End :End Last edited by Guest on 01 Jul 2010 09:59:46 am; edited 1 time in total
john massey

Joined: 26 Jul 2009
Posts: 50

john massey

Joined: 26 Jul 2009
Posts: 50

 Posted: 29 Dec 2009 11:31:40 am    Post subject: I have found a bug in REDUE21. I do not know why or how to fix it. I my initialization Program I did this: ClrList ⌊JONL5 SetUpEditor ⌊JONL5 The bug centers around this block of code. For(J,1,dim(⌊JONL4 If 3<⌊JONL4(J J→⌊JONL5(1+dim(⌊JONL5 End What it supposed to do is to index JONL5 whenever JONL4 is > three seconds. Well L4 holds {3,4,4,3,2,3,3, 2,3,3,3,4} If everything were working correctly JONL5 would hold {2 3 12} because these are the only values where JONL4 is > three seconds. JONL5 holds{2,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,12} You can see JONL5 got the first and last numbers correct. I have no idea where this other stuff comes from.
john massey

Joined: 26 Jul 2009
Posts: 50

 Posted: 30 Dec 2009 07:30:26 am    Post subject: Is there any suggested test that I can run that will help us find the cause of this problem. For example put a STOP someplace in REDUE21 and look at OVER1, JONL! , JONL4 and JONL5
john massey

Joined: 26 Jul 2009
Posts: 50

 Posted: 30 Dec 2009 01:52:50 pm    Post subject: I took my own suggestion and inserted the following code at the end of the loop in REDUE21 If J=5:STOP I wrote a little program that uses OUTPUT statements to look at the values which exist at the time of the stop instead of messing with it on the home screen. It looks like this: Output(1,1,"L4 " Output(1,5,⌊JONL4 // JONL4 holds reaction times. These values are OK for example in my test it contained 4 6 3 3 3 Output(3,1,"L5 " Output(3,5,⌊JONL5 // JONL5 should contain reaction times > 3 seconds it should contain 1 2 Output(6,1,"L1 " Output(6,5,⌊JONL1 // JONL1 should contain values where there are errors. Pause Here is the little program that relates JONL4 and JONL5. The values in JONL5 were 1 2 2 1 2 1 2. Notice that the first two numbers are the same then two reverse repeats. For(J,1,dim(⌊JONL4 If 3<⌊JONL4(J J→⌊JONL5(1+dim(⌊JONL5 End J→⌊JONL1(1+dim(⌊JONL1 // this the error handler when the child inputs an incorrect answer. It contained 2 3 4 Since J can only have 1 3 5 Something is not working correctly here either. Please help me. I feel we are very close but I have no idea what can be done. thanks in advance
 Display posts from previous: All Posts Oldest FirstNewest First
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.

»
 Page 1 of 1 » All times are UTC - 5 Hours