Тема: Паскаль
Показать сообщение отдельно
Старый 07.10.2003, 04:37   #12
Участник
 
Регистрация: 21.01.2003
Сообщений: 57

ICQ: 332049

Репутация: 0
По умолчанию

AleZZandre, попробуй скомпилить вот это:
и увидишь что выведется 40.
или вышеприведенный исходник компиль - я проверял - все правильно :)
Да ну и RTFM конечно никто не отменял, вот ниже я привел справку о "break";
Код:
{$APPTYPE CONSOLE}
program rrr;
var i:word;
begin
i:=1;
while (i<100) do
begin
   inc(i);
   if i=40 then break;
end;
writeln(i);
readln;
end.
delphi6.hlp (break procedure)
============================== =====
Causes the flow of control to exit a for, while, or repeat statement.

Unit

System

Category

flow control routines

procedure Break;

Description

The Break procedure causes the flow of control to exit a for, while, or repeat statement and continue at the next statement following the loop statement.

A call to Break must be contained in a for, while, or repeat statement, or the compiler reports an error.

Note: Break does not violate the flow of control dictated by a try..finally construct. If a break occurs inside the try clause, the finally clause is entered.
ZLOST вне форума   Ответить /