I have proved, to myself, that to escape from any For( loop I can just put up "If J=17" and it will escape of the Loop in question was For(J,1,Dim(L1 that works fine if Dim(L1 is constant.

To prove that myself I did this
For(i,1,100
TEXT(1,1,"Any test in here will do
End

Then I checked "I" on the home screen. It was 101.

When I am calling the same program regressively using "For(I,1,Dim(L1"
the correct value for the escape criterion gets smaller, as the regression converges.

I tried "1+Din(L1" on the home screen it worked fine. That is, if Dim(L1 was 3 the statement returned 4.

I then tried, the code below, from within my regressive program. I does not work
If 1+Dim(L1
Then
Recall the regressive program
END
john massey wrote:

Code:
```If  1+Dim(L1 Then Recall the regressive program END```

"If 1+Dim(L1)" does not check anything. Essentially, you're writing "If 4, do ____ ". Since 4 is not equal to 0, it is always a "true" statement.

If Dim(L1>Dim(L1
john massey wrote:

If Dim(L1>Dim(L1

That would always come out as false. It's the equivalent of "If 0"
I'm still confused as to what you're trying to do... Could you explain?
In my original post I needed to find a regressive program with the same code, since the change in Din(L1 from regression1 to regression2 is unknown. I my original post I did not do a very good job at that, I hope this is better.

For example if (dim(L1 is 8, in regression1. Then in regression2 If (dim(L1 is 4. I need a universal escape criterion for both the 1st and 2nd regression.

Not clear? Fire away
John, it'd be nice if we could get a larger block of REAL code to see exactly what you are dealing with here. From what I can understand you are just needing to escape a For( loop, and the easiest way to do that is ramp the variable the For( loop is changing to something astronomical.

But if you are going to do that, perhaps a Repeat or While loop would suit your needs better, that way you can put the clause in the beginning of the loop and perhaps kill 2 birds with one stone.

Code:
```{1,0,0,7}→⌊TEMP6 For(J,1,dim(⌊TEMP6 If J=5:Stop If ⌊TEMP6(J)=0 End Output(1,1,"JA Output(1,4,J Output(2,1,"TM Output(2,5,⌊TEMP6 Pause ClrHome End SortD(⌊TEMP6 sum((⌊TEMP6≠0)→dim(⌊TEMP6 SortA(⌊TEMP6 Output(3,1,⌊TEMP6 Pause ClrHome```

This is my attempt to make a much more clearer explanation of the problem, as well as proposing a potential solution.

Here is the code under discussion. The present exit criterion is "If J=5:Stop" This is not however a universal exit criterion.
I propose the follow solution with the naming of a list Called TEMP20.
Since this must universal in all regressions of the prgrREDUE22.
We next clear TEMP20.

Then we need a little code that will:

Count the "0s" in TEMP6 which is 2 and add 1. Then the exit criterion is

If Dim(TEMP20:prgmREDUE22
which will process the next regression with two less values Also since the calculator will know the value of TEMP6 at all times it will not be shown in the program, just the code you write.
john massey wrote:

Count the "0s" in TEMP6 which is 2 and add 1.

Code:
`1+sum(not(LTEMP6`

Quote:
Then the exit criterion is

If Dim(TEMP20:prgmREDUE22
which will process the next regression with two less values Also since the calculator will know the value of TEMP6 at all times it will not be shown in the program, just the code you write.

What exactly does REDUE22 do?
You wrote my solution was "1+sum(not (TEMP6"
I think it should be"1+sum(not (TEMP6-->TEMP20"

I appreciate in interest in REDUE22
This is a long story.
First there is a program called MOD2. It displays 16 flash cards on the 84. The 84 holds 10 flash cards at a time. There are two error conditions. The first one is a math mistake and the second one is reaction times >three seconds. I call these "long times". If the child child has one math error and no long times the child graduates from this program on goes onto the next program. If not, all Math errors and long times are transferred to REDUE22. Here the program skips the flash cards that were done properly in MOD2. REDUE22's job is to eliminate correct answers recursively. So once the child has seen his mistakes often enough, the child will decide on the correct answer and no long times. At this point the child will have brought recursion to a halt and REDUE22 will send the child go back to MOD2. This back and forth between MOD2 and REDUE22 goes on until the child can pass the MOD2 tests.

This process has been developed by Mary Robinson. She has a masters in education with a speciality with children with reading and math disabilities. When I retired, I decided that I wanted to spend my remaining good years helping children with their math skills. I am working to put Mary's process on an 84. Then I can send these 84's anywhere there is power to help children.

I cannot loose money, but I will not take a salary. Thus I just need to sell the calculators at a high enough cost to cover my out of pocket costs.

I have a confession to make. For years I had used little tricks to do addition. For example if I wanted to add 7 & 8. I would think 7 +3 which I will borrow from the 8 to make 10 and my remainder 5 from the 8 would give me the correct answer. When I started out I could do that in 3 seconds. So this a process of learning so that the child actually memorizes the correct answers.

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.

»
» 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