How to compare two numeric variables?

Why is my While condition evaluating to false?
image

There are probably other ways to do this, but you need to use a Calculation condition, not a Variable condition. (And I assumed you'd want to increment Local_ScrollCount so you're not stuck in the loop forever.)

_scroll test.kmmacros (2.8 KB)

-rob.

1 Like

Perfect! Thank you!

You could also set it up with a variable condition like you did, only typing in your "variableName" ("Local_ScrollAmount") without the the %Variable%% token.

The is < condition means 'is numerically less than' and turnes the input field into a Numeric calculation field, indicated by the small C (pointed out by the green arrow above) in the corner of the input field (while the input field is selected). And in numeric calculation fields you should just use your "varName" by itself. [Variables].

When that same corner show a T, indicating that it is a Text input field, as when using the contains condition, you should type in your variable, with token, like how you did.

And for completeness: When the corner show a V it indicates that it is a Variable input field, where you need to type in your variable without token, the same as in a Calculation field. [Using Variables]

1 Like