Syntaxe | |
For compteur = debut to fin ... instructions répétées ... Next ou
For compteur = debut to fin Step pas... instructions répétées ... Next |
Dim Ph Ph="liste des nombres pairs entre 0 et 10 :" for i=0 to 10 step 2 ph=Ph&i&" " next Alert ph
|
Syntaxe While-Wend | Syntaxe Do-Loop |
While condition ... instructions répétées ... Wend |
Do ... instructions répétées ... Loop Until condition |
Syntaxe | |
If condition Then ... instructions1 ... Else ... instructions2 ... End If |
Prem=true d=2 n=document.all.nb.value While prem and (d<=sqr(n)) If n mod d=0 Then prem=false Else d=d+1 End If Wend If prem Then Alert "OUI, "&n&" est un nombre premier" Else Alert "NON, "&n&" n'est pas un nombre premier" End If |