PAGINE
ASP
Periodico
n. 2- Febbraio 1999
Cicli
condizionali
La
sintassi di questi "operatori" è molto semplice
e intuitiva per chi è solito operare con un linguaggio
di programmazione, non mi dilungherò quindi nelle
spiegazioni, potete approfondire a riguardo qualsiasi
manuale di programmazione.
-
If Then Else -
<CODE>
If (condition) Then
'some
code
Else
'some
other code
End If
-
If Then ElseIf -
<CODE>
If a = "1" Then
'do
this
Else If a = "2"
Then
'do
this
Else If a = "3"
Then
'do
this
Else If a = "4"
Then
'do
this
End If
End If
End If
End If
-
Case Select -
<CODE>
Select Case a
Case "1"
'do
this
Case
"2"
'do
this
Case
"3"
'do
this
Case
"4"
'do
this
End Select
</CODE>
-
For Next -
<CODE>
For CounterVar = FromCount
to EndCount
'what
you want to do
Next
-
Do Loop -
<CODE>
i = 0
Do While i < 5
Response.Write("i="
& i & "<br>")
i = i + 1
Loop
-
While Wend -
<CODE>
While NOT RS.EOF
Response.Write("Name
= " & RS("lname") & ",
" & RS("lname") & "<br>")
RS.MoveNext
WEnd
</CODE>
By:
Jared Stauffer
Prosegui...