Problem with while function

Problem with while function - Messages

#1 Posted: 2/16/2009 11:24:49 PM
dominator86

dominator86

0 likes in 5 posts.

Group: User

I'm not sure but I think it's a bug. I tried to use the while function and when I want to converge a number to a constant there is no problem. But when I want to converge two numbers to each other like below, the program stops working.

Example:

x:=0
a:=20-2*x
b:=15-x
while a>b x:=x+1
#2 Posted: 2/16/2009 11:54:23 PM
Andrey Ivashov

Andrey Ivashov

2269 likes in 3729 posts.

Group: Super Administrator

This is not a bug.
Second line (a:=20-2*x) program calculate as a:=20, becouse you've define x:=0; third line has similar result, so your condition in while loop is allways true.

Here is solution:

(download an example)
  • New Posts New Posts
  • No New Posts No New Posts