KidsLovePC Contact Us
  Home   PHP  Graphics ASP  JavaScript   J2EE  HTML  JAVA   Swing   Webtip  Forums  Lyric  Free sheet music  Ringtones

Looping Controls

VBScript support the For next loop constructs. The following example consists of two forms. The first form accepts a start and end data which it passes to the second from which generates an HTML page with one game line for each day.

ForNextForm.asp
<html>
<head>
<title> For next form</title>
</head>
<body>
<h2>Weekly Client contacts</h2><br>
<form action="ForNextAction.asp" method=post>
<p> Please enter the first day of the week in the form mm/dd/yy such as 07/01/78</br>
<input type="text" name="start">
<p> Please enter the last day of the week in the same form<br>
<input type=text name="end"><br>
<input type=submit>
<input type=reset>
</body>
</html>

ForNextAction.asp
<html>
<head>
<title>For next Action</title>
</head>
<body>
<h2> Weekly games for Harry Potter</h2>
<% varStart=Request.form("start")
varEnd=Request.form("end")
varStart=cdate(varStart)
varEnd=cdate(varEnd)

varNumberDays=(varEnd-varStart)

For varLineCounter=0 to varNumberdays
response.write "Games:"+varLinCounter+" ___________________"
response.write "<br><br><br>"
next
%>
signed ________________________

Harry Potter
</body>
</html>

How it works:

The program retrieves the start and end dates as strings, converts them to dates through cdate function, then subtracts the start from the end to determine the number of game lines to produce. The then loops using the For Next control structure to print out the lines.


ASP tutorial
What is ASP
Install IIS
VBScript or JScript
ClientSide vs ServerSide scripting
ASP execution order
Dealing with Form
More Form example
Variable &Variant
String
Local variable
Global variable
Arrays
Use if_then_else
Use Select Case
For_Next loop
Do_while loop
Subroutine vs Function
Request Object
QueryString
Count Keyword
Using QueryString
Application, Method, Events
Create Virtual Directory
Save array in Application
Session, Method, Events
Using Cookie
Server Object
Ad Rotator
Content Linker
Browser
Dictionary object
Filesystemobject Object

 

 

 

Best books about ASP & ASP.Net from Amazon
Beginning Dynamic Websites : with ASP.NET Web Matrix (Programmer to Programmer) (Paperback) Build Your Own ASP.NET Website Using C# & VB.NET (Build Your Own) (Paperback) Professional Active Server Pages 3.0 (Programmer to Programmer) (Paperback) ASP.NET Cookbook (Paperback) ASP.NET Kick Start (Paperback)

 

Printer Inkjet A Z lyricsLearn ChineseHome|PHP|Swing|HTML|JavaScript|ASP|JAVA|Forum|WebTip|Contact Us
Copyright © kidslovepc.com All rights reserved(new). Privacy|Copyright
designed by info@kidslovepc.com

Please help us cover the web site maintenance fee.
barcode scanner Thermal Printer credit card machine bar code printer