Problem with while function

Problem with while function - Сообщения

#1 Опубликовано: 16.02.2009 23:24:49
dominator86

dominator86

0 сообщений из 5 понравились пользователям.

Группа: 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 Опубликовано: 16.02.2009 23:54:23
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: 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)
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений