hello
I'm having a bit of a problem the loop dose not seem to work well .
example1 : loop while Variable = 10 ..............The loop ends imeditly !
example 2 : loop while varible1 = variable2 ......The loop ends imeditly !
example3 : loop while Variable < 10 .............. works fine !
example4 : loop while Variable > 10 .............. works fine !
can any one help please am i doing something wrong ?
Thanks in Advance
Regards Alan
Loops
hello
Wath do you mean
i just made a simple program to test it loop while variable =10 and in the loop a calculation variable = varable +1 but it dose not work
The variable value is 1 and the loop ends !
This is from MM course :
The properties dialogue box shows you the options you have for controlling the loop. Next to the 'Loop while:' statement is the loop control text box. In this text box you put the loop condition: the loop will keep running until this condition is met. For example in this text box you could write:
count = 10 (Loop runs while variable count = 10) (not working)
count > 4 (Loop runs while variable count is greater than 4) (ok works)
count = preset (Loop runs while variable count is the same as variable reset) (not working)
Wath do you mean
i just made a simple program to test it loop while variable =10 and in the loop a calculation variable = varable +1 but it dose not work
The variable value is 1 and the loop ends !
This is from MM course :
The properties dialogue box shows you the options you have for controlling the loop. Next to the 'Loop while:' statement is the loop control text box. In this text box you put the loop condition: the loop will keep running until this condition is met. For example in this text box you could write:
count = 10 (Loop runs while variable count = 10) (not working)
count > 4 (Loop runs while variable count is greater than 4) (ok works)
count = preset (Loop runs while variable count is the same as variable reset) (not working)
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Hello
The while loop will only work when then condition is true.
EG while var1 = 10 will run forever while var1 is equal to 10.
if var1 starts off at 1 then the while loop will never run because var1 does not equal 10.
You can make a while loop run a set number of times by double clicking the icon and selecting the loop count option.
The while loop will only work when then condition is true.
EG while var1 = 10 will run forever while var1 is equal to 10.
if var1 starts off at 1 then the while loop will never run because var1 does not equal 10.
You can make a while loop run a set number of times by double clicking the icon and selecting the loop count option.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Steve
- Matrix Staff
- Posts: 3433
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
If you have a while loop with the condition "count = 10" at the beginning of the loop, it will only enter the loop if the "count" variable equals 10. If "count" does not equal 10 before the loop command, then the loop will never be entered.
I think the statement "the loop will keep running until this condition is met" is not right and might be causing confusion. It should probably say "the loop will keep running while this condition is true".
I think the statement "the loop will keep running until this condition is met" is not right and might be causing confusion. It should probably say "the loop will keep running while this condition is true".