Normally a loop counter counts 1,2,3,4,5.... I want this counter to skip counts so it might count 1,3,5,7 instead. Here is the concept. Our list will always contain 16 numbers. We insert a "0" whenever we want to skip a count. Since our original list may contain {1,3,5,7,9,11,13,14,15} We insert "0s" to make the complete list called OVER to hold 16 elements. So that list will look like this {1,0,3,0,5,0,7,0,9,0,11,0,13,14,15,0}. I need the code that will skip the "0s"
For further clarification:
For(I,1,16
your code goes here
Below here is a lot of code that looks like
{12,13,22,with16 numbers}--> AN001(I)
When you code sees a "0" it will search in the program and since all the "I" values are greater than "0" not process the code associated with the 13 in the above example since it is the first "0"

Confused Fire away with questions
Okay. Check the list element. If it equals zero increase I by one inside the loop. So, perhaps:


Code:

For(I,1,16
your code goes here
Below here is a lot of code that looks like
{12,13,22,with16 numbers}--> AN001(I)
If AN001(I)=0
I+1->I
Or something similar.
Well that is the first thing I tried but no deal. Wink
I just noted something I forgot to mention in my previous post. The list is called OVER. The first thing I tried was
if Over(I)=0
I+1-->I
but no deal. You will need to dig deeper Wink
I will take a look at this in a short bit, have a little bit of work to accomplish first, and I will then answer your question.
The STEP extra argument?

For([var],[lower bound],[upper bound],[step (optional)]

Basic is long ago... But iirc it will add [step] to the var instead of default 1.

EDIT: oh, I just realized this doesn't quite cover everything you want.
Do you have any of the coding itself done for the stuff below? Can you please post it if you do? Or post the source in its entirety so I know EXACTLY what you are trying to accomplish without having to guess. Then I could more easily write up something that should work.
Well, whenever you create a list, isn't everything set equal to 0?

So,

Code:

:For(A,1,15,2)
:A->OVER(A)
:End

Code:
seq(N(iPart(N/2)!=N/2),N,1,16)--> LOVER


...I'm sure someone can optimize...
john massey wrote:
I just noted something I forgot to mention in my previous post. The list is called OVER. The first thing I tried was
if Over(I)=0
I+1-->I
but no deal. You will need to dig deeper Wink
That was going to be my suggestion, I'm surprised it didn't work. In what way did it fail? Did it skip nothing, or did it skip the wrong items?
It has been a long time since I did this and my memory is in the tank. I believe that The result was that there was no skipping.

Perhaps this might work.

If OVER(I)=0
then
I+1=I
Else
// then stick an END statement at the very end of the program to complete the Else statement. What say you?

I am at my daughters house without my desktop mac so I cannot test this idea until after christmas. The best christmas present you could sent me is one of these Good Idea if you think we are on the correct path.

thanks in advance
Without more information as to what you are scanning and the syntax of what you are trying to scan, would be really helpful if you could post up a sample of what you are doing, but if you can't get it until after christmas.. ><

You might want a While loop in this case, gives you more control.

I am guessing that the even elements will not always be 0, will they?
Here, this does the trick, I just tested it in WabbitEmu:


Code:
:{1,0,3,0,5,0,7,0,9,0,11,0,13,14,15,0->LOVER
:For(I,1,dim(LOVER
:If 0=/=LOVER(I
:Then
:Disp I
:"OR OTHER CODE TO EXECUTE
:End:End

Prints:

Code:
1
3
5
7
9
11
13
14
15
Done
If you read the first post tho, he needs it to scan the code further down somewhere.

This is why I have been requesting his code so I can just make that work. XD
tifreak8x wrote:
If you read the first post tho, he needs it to scan the code further down somewhere.

This is why I have been requesting his code so I can just make that work. XD
Good point; as we conversed on IRC, I missed the second part of that post. As per SAX/IRC:

Quote:
[19:26:03] <saxjax> (C) tifreak8x: he needs it to scan code, so the skipping part isn't going to hlep
[19:26:03] <saxjax> (C) tifreak8x: help*
[19:26:47] <+KermM> I'm not sure about that
[19:26:57] <+KermM> "Our list will always contain 16 numbers. We insert a "0" whenever we want to skip a count."
[19:27:02] <+KermM> if that is indeed true, my code will work
[19:27:35] <+KermM> oh wait
[19:27:43] <+KermM> I think I'm missing the point of the second part of his post
[19:27:50] <saxjax> (C) tifreak8x: your code will work for skipping XD
[19:27:50] <saxjax> (C) tifreak8x: yeah
[19:28:00] <saxjax> (C) tifreak8x: like I said, we need more info to better help him
[19:28:21] <+KermM> indeed
Can I attach my code and then send it somewhere or do I just post it?
It is fairly well documented but is about 3K and thus long. It has about 12 programs within it. Is it important for you to know the functions do? I will get home on saturday. Just let me know what you want me to do.
I want to discuss what my program is about. I is called REDUE21 It is to be used to teach math to children starting in the 2nd grade. The skills are addition, subtraction multiplication and division. There are 10 flash cards / problems on a graph screen.

Each flash card uses Text statements to print out things. Envision the following individual flash card layout.
5 // Five is first number in the flash card at the top of the flash card. The number five and the X & Y coordinates are in user lists.

Just below and to the left on the five is the math symbol. + In this case. Again the location of the various math symbols and their X & Y coordinates are all controlled by user lists.

Directly below the Five is the second number lets make it four.

Below the four is a short line

Below that is a ?. The ? is my prompt.

When a child sees that they are trained to

1 Recognize that they must take some action
2 Decide on the correct answer for this flash card in this case 9
3 Enter 9 from the keyboard
4 Press good old 105.

If the answer is correct and reaction time between the ? and 105 is less 3 seconds in the next iteration of REDUE21 that ā€œIā€ will become a ā€œ0ā€ How do you make a one into a zero you ask. Well at the top of REDUE21 before the for loop is a small program called ADD0 that inserts zeroes for any value where is a space in OVER1. When completed the first iteration of OVER1 may look like this {1,3,5,7,9} In the second iteration of REDUE21 OVER1 after running ADDO will look like this {1,0,3,0,5,0,7,0,9,0,0,0,0,0,0,0,}
Where is all this going you ask? Well after N iterations of REDUE21 you end with

{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} That is the object of REDUE21

Just a though about my life and my activities since starting working programming the 84+SE
I managed a very large shipboard test program. I provided the test results to the system engineers and they decided what to do with the problem to fix it. That arrangement made for the most successful shipbuilding in the history of the world.

I believe that this process has been very successful in my progress on this process while working on the 84+SE. That is I put up a problem, site members made suggestions and I tested

That is I put up a problem and they make suggestions and I test and report results.
Regarding this particular problem I was bathing in a tub of stupidity. I spent three months in the tub.

A few days ago I Thought about my problem in a completely different way and made my post on your site. You all understood! I can see my issues in this process converging. I have learned how to report a problem.
1. Run a program
2. When an error occurs record the message and press 2 to go to that location and note where the cursor sits
3. Run the program again and press 1 to stop then and then go to the home screen and see look at the variables in question
4. I report my test results to the site members

In the case of REDUE21 I spent three months understanding my problem and learning how to explain my problem in a way that your site members could understand. But that has finally happened.
I believe I put your present recommendations into REDUE21 and report back faster than site members can comprehend my program
Test data to report.
Specific implementation follows:

For(J,1,dim(⌊OVER1
If 0=/=⌊OVER1(J // syntax error occurs here at the "/"
Then

At the very end of REDUE21 I added another "end" to close your If statement.

initial values of ⌊OVER1 were {1,3,5,7,9,11,13,15,16}
I made a mistake in reference to the prgmADD0 earlier because I could not remember. It is prgmPUTO. It inserted the "0" as required.

When I quit at the syntax error, I tested on the home screen. ⌊OVER1 returned all the numbers with "0s" placed as expected and ⌊OVER1(J) returned a"1"
Oh, pardon my lack of explanation. I use =/= to represent the "not-equal" sign when I don't have a character map handy to type the ≠ symbol. Please make that replacement and let me know how it works.
Thanks for your quick response.

With this:

If 0=≠=⌊OVER1(J //got the syntax error over the ≠

Is there any data you would like from the home screen? Any troubleshooting techniques you can teach me that will bring us to closure?
  
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
Page 1 of 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

 

Advertisement