Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
Repeat Statement
The repeat statement executes until the condition becomes false. The syntax of the
repeat statement is:
repeat statement until expression
statement
is executed repeatedly as long as expression evaluates true. The
expression
is evaluated after each iteration, so the loop will execute 
statement
at
least once.
Here is an example of calculating scalar product of two vectors, using the 
repeat
statement:
s := 0; i := 0;
...
repeat
begin
s := s + a[i] * b[i];
i := i + 1;
end;
until i = n;
170
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroPASCAL PRO for AVR
CHAPTER 5