A
A
Alexander Gogsan2021-04-01 11:58:19
Programming
Alexander Gogsan, 2021-04-01 11:58:19

Need an explanation in the Cycle?

Hello! Why is it necessary to write Step = Step + 1
for the cycle ?

Шаг=1;
Пока Шаг<=10 Цикл;
  Сообщить(Шаг);
  Шаг = Шаг+ 1;
КонецЦикла

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladimir Lewandowski, 2021-04-01
@vovaspace

For the cycle to end. Otherwise Step will always be 1 (initial value) and the Step <= 10 condition will never be met.

1
12rbah, 2021-04-01
@12rbah

If you do not register, then the cycle will go on indefinitely, because. the step without increment will be equal to 1 and the condition for the end of the cycle will not be fulfilled, and when the step becomes more than 10, the cycle will be interrupted.

I
ior, 2021-04-07
@ior

In fact, this is the whole essence and purpose of the cycle - to perform any operations - step by step - a certain number of times. In this case, moving from the first step (1) to the last step (10) is done by increasing the Step variable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question