Problem with while function

Problem with while function - Mensajes

#1 Publicado: 16/2/2009 23:24:49
dominator86

dominator86

0 me gusta en 5 mensajes.

Grupo: 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 Publicado: 16/2/2009 23:54:23
Andrey Ivashov

Andrey Ivashov

2.343 me gusta en 4.056 mensajes.

Grupo: 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)
  • Nuevos mensajes
  • Sin mensajes nuevos