|
ASP
Instruction Script |
| |
Do While...Loop
Again, we will define a condition and one or more
instructions:
<%
mynumber=0
Do While mynumber<10
response.write("Hello<HR>")
mynumber=mynumber+1
Loop
%>
In this example the condition is "mynumber<10" and the
instructions defines a response text and an increment of
the variable "mynumber". In the example, mynumber will
be increased until it gets a value of 10. Then the loop
will be abandon. Several instruction may be used within
the loop. |
|
|
Do Until....Loop
Quite similar to the previous one, it also includes a
condition and one or more instructions:
<%
mynumber=0
Do Until mynumber=10
response.write("Hello<HR>")
mynumber=mynumber+1
Loop
%>
In this example the condition is "mynumber=10", so
mynumber will increased until it is equal to 10, and
then the loop will be abandon.
Let's see an example using this Do Until...Loop:
<%
myfirstnumber=0
mysecondnumber=0
Do Until myfirstnumber=15
Do Until mysecondnumber=15
response.write("X")
mysecondnumber=mysecondnumber+1
Loop
Response.write ("<BR>")
myfirstnumber=myfirstnumber+1
mysecondnumber=myfirstnumber
Loop
Response.write ("END")
%> |
|
|
Select Case....End
Select
This is a very useful instruction in case we want to
check different values for variable. Lets check an
example:
<%
mynumber=3
Select Case mynumber
Case 1
Response.write ("Number 1")
Case 2
Response.write ("Number 2")
Case 3
Response.write ("Number 3")
Case 4
Response.write ("Number 4")
Case 5
Response.write ("Number 5")
Case Else
Response write ("Mynumber is higher than 5")
End Select
%>
In this example above, we have defined mynumber as 3, so
they are executed the instructions following line 8 (in
this case only one instruction is executed, but they may
be several instructions). Case Else is not necessary.
Let's try a second example:
<%
username=request.form("username")
Select Case username
Case "Peter"
Response.write ("Hello, Peter")
Case "John"
Response.write ("Hello, John")
Case "Joe"
Response.write ("Hi, Joe")
Case Else
Response write ("I do not know you")
End Select
%> |
| |
| |
|
|
|
DOWNLOAD FILE (PDF) |
|
|
|
|
|
: "dikutip
dari berbagai sumber." |
|
|
 |
RESOURCES | |
 |
FREEWARE |
| |
Change Type 1.0 Clear Template 1.0 Cryptext
3.3 HJ Split 2.2 TweakUI W98 Winamp 5.02 | |
 |
SHAREWARE |
| |
Linguist 1.0 Picaview 1.31 SafeClean 3.02 Winhex 10.54
Winrar 3.11 Winzip 9.0 | |
 |
TUTORIAL |
|
|
|
|
|
|
|
|
|
|
|