Difference between revisions of "For"

From Free Pascal wiki
Jump to navigationJump to search
m
Line 1: Line 1:
 
[[Keyword|keyword]] used with "[[to]]"\"[[downto]]" and "[[Do|do]]" for a loop:
 
[[Keyword|keyword]] used with "[[to]]"\"[[downto]]" and "[[Do|do]]" for a loop:
 +
<delphi>
 
   for I:=1 to 100 do
 
   for I:=1 to 100 do
 +
</delphi>
 
(repeats the actions for a hundred times,from 1 to 100)
 
(repeats the actions for a hundred times,from 1 to 100)
 +
 +
<delphi>
 
   for I:=100 downto 1
 
   for I:=100 downto 1
 +
</delphi>
 
(repeats the actions for a hundred timed,from 100 to 1)
 
(repeats the actions for a hundred timed,from 100 to 1)
*you can use [[type|types]] instead of numbers.
+
 
 +
*you can use [[Type|types]] instead of numbers.
  
 
{{Keywords}}
 
{{Keywords}}

Revision as of 07:25, 17 October 2007

keyword used with "to"\"downto" and "do" for a loop: <delphi>

 for I:=1 to 100 do

</delphi> (repeats the actions for a hundred times,from 1 to 100)

<delphi>

 for I:=100 downto 1

</delphi> (repeats the actions for a hundred timed,from 100 to 1)

  • you can use types instead of numbers.


Keywords: begindoelseendforifrepeatthenuntilwhile