» Goto page Previous  1, 2, 3
We were without power for a while. The reason that your program ran was that you have no previous value of OVER1 in your calculator. I have a solution for this problem, I hope, and will run the code and report back

Code:
```{1,0,3,0,5,0,7,0,0,0,0,0,0,0,0,0→LOVER1 {3,5→LTEMP6 For(J,1,dim(LTEMP6 LOVER1*(LOVER1!=LTEMP6(J))→LOVER1 End Output(1,1,LTEMP6 Pause ClrHome  ```

I got an invalid Dim error at the end of OVER1 I never got an output statement. I checked J on the home screen it was 5 so that says that the loop is running. I reset J as shown below, because of the invalid dim error I got no output statement

Code:
```0→J {1,0,3,0,5,0,7,0,0,0,0,0,0,0,0,0→LOVER1 {3,5→LTEMP6 For(J,1,dim(LTEMP6 LOVER1*(LOVER1!=LTEMP6(J))→LOVER1 End Output(1,1,LTEMP6 Pause ClrHome```

When I checked OVER1 on the home screen it showed. {1,3,5,7}
at this point I am lost. Perhaps the "clearlist OVER1"then "setupeditor OVER1 the code below would not give us an invalid dim error.

Code:
`{1,0,3,0,5,0,7,0,0,0,0,0,0,0,0,0→LOVER1 `
If the For loop executed, J could only be one or two. If J was equal to five when you checked, J must have been five before the For loop began, and it must have encountered an error before the loop began. If the LOver1 was {1,3,5,7}, since there’s no way that code could do that, it probably didn’t execute the line that stores stuff into the list. I'm not sure why you would get an invalid dimension error though.

Code:
```ClrHome 0→J For(J,1,dim(LTEMP6 LOVER1*(LOVER1!=LTEMP6(J))→LOVER1 End Output(1,1,LTEMP6 Pause ClrHome```

This is about clearing out old values from preexisting condition of a variable somewhere that makes this program cause errors. This AM I fixed the problem with OVER1 . It now holds

Code:
`{1,0,3,0,5,0,7,0,0,0,0,0,0,0,0,0}`

I then went to the Home screen and set and verified that

Code:
`{3,5}→ TEMP6`

was valid
Now I get a Data Type error at the end of this

Code:
```For(J,1,dim(LTEMP6 ```
john massey wrote:

Now I get a Data Type error at the end of this

Code:
```For(J,1,dim(LTEMP6 ```

That "L" in "LTEMP6" is meant to be "⌊". Whenever we're handling lists, the list name is preceeded by that character, but on Cemetech, it is much faster for me to type "L" instead.

Code:
```ClrHome 0→J Output(1,1,"JA Output(1,5,J Output(2,1,"TA Output(2,8,⌊TEMPA Output(3,1,"OV Output(3,5,⌊OVER1 Pause ClrHome For(J,1,dim(LTEMPA LOVER1*(LOVER1!=LTEMPA(J))→LOVER1 End Output(1,1,"JA Output(1,5,J Output(2,1,"TA Output(2,8,⌊TEMPA Output(3,1,"OV Output(3,5,⌊OVER1 Pause ClrHome```

This is just a simple test routine where some other code has set the values of TEMPA to {3,5} and OVER1

Code:
`{1,0,3,0,5,0,7,0,0,0,0,0,0,0,0,0}`

So to get this code running you need to set these lists to the contents above from your home screen, prior to running this code

Just to verify that everything is correct I did this

Code:
```Output(1,1,"JA Output(1,5,J Output(2,1,"TA Output(2,8,⌊TEMPA Output(3,1,"OV Output(3,5,⌊OVER1 Pause```

If you followed my instructions you should see the data that you entered from the home screen. Up to now this is a no brainer, right. So why do I get a data type error at the end of this line of code?

Code:
`For(J,1,dim(LTEMPA`

I have read the definition of a data type error. Perhaps the problem is in this

Code:
`LOVER1*(LOVER1!=LTEMPA(J))→LOVER1`
have you tried

Code:
```dim(Ltempa) For(J,1,Ans Extra code goes here End```
I implemented your suggestion, as follows.

Code:
```dim(LTEMPA) For(J,1,Ans LOVER1*(LOVER1!=LTEMPA(J))→LOVER1```

I got an invalid dim error after the first line of the code above. I checked

Code:
`dim(LTEMPA)`

On the home screen and it returned 2 which is correct. TEMPA holds {3,5}

Code:
`LOVER1*(LOVER1!=LTEMPA(J))→LOVER1`

The code above is supposed to change OVER1 which I call first OVER1 shown below

Code:
```{1,0,3,0,5,0,7,0,0,0,0,0,0,0,0,0} {1,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0}```

Which I call second OVER1 shown above. This is done by inserting "0s" in second OVER1 where are common values in TEMPA and OVER1
For the definition of DATA TYPE error

Quote:
For a function(including implied multiplication

I question therefor that this

Code:
`LOVER1*(LOVER1!=LTEMPA(J))→LOVER1`

Is the code above the source of our problem. I ask can anyone independently just test the above line of code or can they just tell me how to fix it or tell me that I am just sniffing glue?

Code:
```dim(LTEMPA For(J,1,Ans LOVER1*(LOVER1!=LTEMPA(J))→LOVER1 dim(LTEMPA End```

The answer variable was just getting altered, that's all.
Emperor,

Given my long post, do you now know what I want to do?

If so do you or anyone else have a solution.

If this is a dead end.

I want to go back to the original problem.

If OVER1 is{1,0,3,0,5,0,7,0,0,0,0,0,0,0,0,0}

Given that TEMPA is {3,5} before the new code, I want the new value of TEMPA to be {1,0,0,7} that is replacing 3 and 5 with "0s"
I think something similar to this was said before, but I don't know where.

Code:
``` 0->dim(LA For(N,1,dim(LOVER1 If prod(LTEMPA-LOVER1(N LOVER1(N->LA(1+dim(LA End SortD(LA sum(LA≠0->dim(LA SortD(LA Delvar N```

If LOVER1 equals (1,0,3,0,5,0,7,0,0,0,0} or something similar, and LTEMPA equals {3,5}, LA will equal {1,7}.

If you want the answer returned to LTEMPA instead, append this code to the end:

Code:
```LA->LTEMP6 Delvar LA```

I think I've got a better solution mapped out in my head, but I won't be able to test it until tomorrow when I get new batteries for my TI. If you want, I'll probably be able to convert it to 8xp then too.

Ooh, that reminds me. Will all of the elements in LTEMPA always be found in LOVER1? (Basically, in the example above, could LTEMPA be equal to {2,3,5}?) If that's the case the program will only need to be about half as big.
OVER1 is a list of all the problems. TEMPA is a list of problems from OVER1 that were answered correctly. The "0s"in OVER1 are problems that were once answered incorrectly but now are removed from OVER1 when the problem is answered correctly. This removal effort is done by a program that comes after your work and is already done and tested.

I await, with great anticipation, the results of your programming art.
All right, so TEMPA will not have any numbers that OVER1 does not have. That's good, that means I can cut the program down to half size. I'll rename the lists my program uses, paste the code here, and upload it somewhere in .8xp format.

Code:
```{1,3,5,7→∟OVER1 {3,5→∟TEMP6 SetUpEditorT7 0→dim(∟T7 For(N,1,dim(∟OVER1 If prod(seq(∟TEMP6(X)≠∟OVER1(N),X,1,dim(∟TEMP6 ∟OVER1(N→∟T7(1+dim(∟T7 End SortA ∟T7```

.8xp format

I just realized that I left the first two test lines in. Those don't do anything, so you can just delete them.

Code:
```{1,3,5,7→⌊OVER1 {3,5→⌊TEMP6 SetUpEditor⌊T7 0→dim(⌊T7 Output(6,1,⌊T7 Pause ClrHome For(Q,1,dim(⌊OVER1 If prod(seq(⌊TEMP6(X)≠⌊OVER1(Q),X,1,dim(⌊TEMP6 ⌊OVER1(Q→⌊T7(1+dim(⌊T7 End SortA(⌊T7 Output(1,1,"QA Output(1,5,Q Output(2,1,"TA Output(2,8,⌊TEMP6 Output(3,1,"OV Output(3,5,⌊OVER1 Pause ClrHome```

I replaced "N" with "Q" since "N" is in use elsewhere.I left the first two lines in because they are required to independently test.
I checked the first 4 lines of code and they were as expected. The last output statements report Q at 5, TA at {3,5} not {1,0,0,7} and OV at {1,3,5,7}
Where did I mess up?
john massey wrote:

Code:
`If prod(seq(⌊TEMP6(X)≠⌊OVER1(Q),X,1,dim(⌊TEMP6`

I think you need another set of parenthesis around "LTemp6(X)!=LOVER1(Q)"... Basically, change the above line to
rthprog wrote:
If prod(seq((⌊TEMP6(X)≠⌊OVER1(Q)),X,1,dim(⌊TEMP6
rthprog,

Glad to see you again. I made your change & checked it twice but I got the same results.

Shall I send you a 8xp file so that you can play with it?
The list T7 should be equal to {1,7}.
Emperor,

I am totally confused

When I check T7 on the home screen I get {1,7} "TA should hold {1,0,0,7}but holds{3,5}
I don't use a list TA. I use list T7. And I forgot you wanted the zeros in there too (Heh heh... oops). I'll go fix that now.

Code:
```{1,3,5,7→∟OVER1 {3,5→∟TEMP6 SetUpEditorT7 0→dim(∟T7 For(N,1,dim(∟OVER1 prod(seq(∟TEMP6(X)≠∟OVER1(N),X,1,dim(∟TEMP6→∟T7(N End ∟OVER1*∟T7→∟T7```

The link to the .8xp is the same as before.

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.

»
» Goto page Previous  1, 2, 3
» 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