While loop with 'less than' not working

Hey guys, I got a while loop that doesn’t seem to be working properly, its setup like this:


vMyVariable is an Int32 and it is currently equal to 1 when it hits this step, I have a message box right before the while loop to confirm it. For some reason it doesn’t run the loop. I’ve also tried making it vMyVariable<vOne which is a Int32 variable that is set to a value of 1 and that doesn’t work, and lastly tried to make it vMyVariable<0 and that doesn’t not work either.

@cssc, because 1 is never less than 1, the condition is always false and so it passes it, try it with a do-while, it will execute once.

Or just change your condition and try saying vMyVariable<=1 it will execute once.


Thanks @SenzoD, I completely mentally blanked out on that for some reason, knew it was something simple like that.

@cssc, no worries man, happens to the best of us & im glad i could help.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.