User Tools

Site Tools


pt:for

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pt:for [2016/01/01 22:47]
pt:for [2020/02/28 10:46] (current)
Line 1: Line 1:
 +===== For / Next =====
 +==== Formato ====
 +**for** //variable// =  //expression1// **to** //expression2// [ **step** //expression3// ] \\
 +//statement(s)//\\
 +**next** //variable//
  
 +==== Descrição ====
 +
 +Esta estrutura faz com que uma variavel assuma os valores de  //expression1// até //expression2// por incrementos de //expression3// 
 +
 +==== Exemplo ====
 +
 +<code>
 +for n = 0 to 10 step 2
 +print n
 +next n
 +</code>
 +Produz
 +<code>
 +0
 +2
 +4
 +6
 +8
 +10
 +</code>
 +
 +==== Ver também ====
 +[[dountil|Do / Until]], [[whileendwhile|While / End While]]