Hello,
When I enter even a basic code for a 'for' or 'do while' loop it does not work. I get a G1001 error. What am I doing wrong?
Thanks.
1 Answer
0
A basic for loop might look like this:
for i(1, 4, 1); print i; endfor;
This code will return:
1.00 2.00 3.00 4.00
If you leave out the endfor statment, you should get the error:
G1001 : found 'End of File' : Expected keyword 'ENDFOR'
A basic do while loop might look like this:
i = 10; do while (i > 0.5); print i; i = i./2; endo;
This code will return:
10.000 5.000 2.500 1.250 0.625
If you leave out the endo at the end, you would get the error:
G1001 : found 'End of File' : Expected keyword 'ENDO'
Your Answer
1 Answer
0
A basic for loop might look like this:
for i(1, 4, 1); print i; endfor;
This code will return:
1.00 2.00 3.00 4.00
If you leave out the endfor statment, you should get the error:
G1001 : found 'End of File' : Expected keyword 'ENDFOR'
A basic do while loop might look like this:
i = 10; do while (i > 0.5); print i; i = i./2; endo;
This code will return:
10.000 5.000 2.500 1.250 0.625
If you leave out the endo at the end, you would get the error:
G1001 : found 'End of File' : Expected keyword 'ENDO'