Loop control varibles

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
sdwx72
Posts: 4
Joined: Fri Dec 01, 2006 7:32 am
Contact:

Loop control varibles

Post by sdwx72 »

Im just wondering if its posible to be able to control a loop with a switch input using a single bit assignment. What I want to do is have a switch input that calls a loop to execute ONLY while the switch is depressed...once i release the switch id like the loop to stop. is this possible?

any help would be great

User avatar
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:

Post by Benj »

It certainly is possible to do that.

Firstly use an input block with the bit you want to test masked. Read this input into a byte variable eg. Bit_Test.

Then use a while block and set the conditions to while Bit_Test

Remember to place an second input block inside the loop to update the Bit_Test variable so that the loop will exit when you stop pressing the switch.

Post Reply