Quantcast
Channel: LiveCode Forums
Viewing all articles
Browse latest Browse all 440

Talking LiveCode • Why me???

$
0
0
This snippet in a small test stack shows three ways to escape a repeat loop when the variable "endSpace" reaches 30:

CODE:

on mouseup   put 29.9 into endSpace   repeat until endSpace / 6 = 5    --repeat until endSpace mod 6 = 0     --repeat until endSpace / 6 is an integer       add 0.1 to endSpace   end repeat   answer endSpaceend mouseup
All three fire properly. But if I place this inside a handler in another project, only the first line escapes the repeat. Even though endSpace attains the value of 30, the other two do not, and endSpace gets to 30.1 and beyond.

How could one stack work and another not???

Craig

Statistics: Posted by dunbarx — Thu Aug 01, 2024 2:51 pm



Viewing all articles
Browse latest Browse all 440

Trending Articles