Subroutines and Functions
We can change the flow sequence by using Subroutines and or Functions.
We call a subroutine, which does its processing and then returns
and we continue executing the statement after the subroutine call.
The following example using two functions to calculate hotel, car
and meal costs based on number of days on the trip.
<title> Function form</title>
<h2> cost calculator for <br>
Visiting Disney World Trip</h2>
Please provide the following information so we can estimate your
<form action="FunctionAction.asp" method=post>
Please type your preference Hotel in location, either city or
<input type=text name="location"><br>
response.write "The "+ numberDasy+" day trip will
cost $" & cost & "<br>"
<h3> you hvave chosen the hottel in <%=varLocation%> <br>
Your estimated costs for this trip will be </h3>
select case varLocation
case "city","City", "CITY"
response.write "The two day trip will cost $" & varCost &"<br>"
response.write "The four day trip will cost $" & varCost & "<br>"
response.write "The six day trip will cost $" & varCost & "<br>"
Response.write "input Error="+varLocation