ASP Source Code ASP File: pgcalc.asp
|
|
<html>
<head>
<title>pgCalc</title>
</head>
<body background="logo.gif" bgcolor="#FFFFFF" link="#0000FF" vlink="#800080"
alink="#FF0000">
<SCRIPT Language="JavaScript">
<!--
function RunASP(URL)
{
window.open(URL, "_self");
}
// -->
</SCRIPT>
<div align="center"><center>
<table BORDER="0" COLS="3" WIDTH="100%" BGCOLOR="#FFFFCC" height="1">
<tr>
<td BGCOLOR="#FFCCCC" width="88" align="center" height="1"><p align="center"><a
href="pgcalc_readme.html"><font face="Verdana" size="2"><strong>Overview</strong></font></a></td>
<td BGCOLOR="#FFCCCC" width="208" align="center" height="1"><form name="Form1"
method="POST" action="../../components/iaspchart/--WEBBOT-SELF--">
<div align="left"><p><select name="D1" size="1">
<option selected value="pgcalc.asp">VBScript</option>
</select><input type="button" LANGUAGE="JavaScript"
onClick="RunASP( document.Form1.D1.options[document.Form1.D1.selectedIndex].value)"
value="Run Sample" name="B1"></p>
</div>
</form>
</td>
<td BGCOLOR="#FFCCCC" width="227" align="center" height="1"><form name="Form2"
method="POST" action="../../components/iaspchart/--WEBBOT-SELF--">
<div align="left"><p><select name="D2" size="1">
<option selected value="pgcalcvb.html">VBScript</option>
</select> <input type="button" LANGUAGE="JavaScript"
onClick="RunASP( document.Form2.D2.options[document.Form2.D2.selectedIndex].value)"
value="View Source" name="B1"></p>
</div>
</form>
</td>
</tr>
</table>
</center></div>
<blockquote>
<form NAME="pgCalc" METHOD="POST" ACTION="pgcalc.asp">
<blockquote>
<b><div align="center"><center><h3><font face="Verdana">Web Calculator</font></b></h3>
</center></div><p><font face="Verdana"><select name="optConnSpeed" size="4">
<option Value="0" Selected>add</option>
<option Value="1">subtract</option>
<option Value="2">multiply</option>
<option Value="3">divide</option>
</select><br>
</font></p>
</blockquote>
<table BORDER="0" CELLSPACING="2" CELLPADDING="2" WIDTH="679">
<tr>
<td ALIGN="RIGHT" VALIGN="MIDDLE" WIDTH="244"><blockquote>
<div align="left"><p><font face="Verdana"><b>First Number:</b></font></p>
</div>
</blockquote>
</td>
<td ALIGN="LEFT" VALIGN="MIDDLE" width="423"><div align="left"><p><font face="Verdana"><input
TYPE="TEXT" NAME="fristnumber" VALUE MAXLENGTH="20" SIZE="20"></font></td>
</tr>
<tr>
<td ALIGN="RIGHT" VALIGN="MIDDLE" WIDTH="244"><blockquote>
<div align="left"><p><font face="Verdana"><b>Second Number:</b></font></p>
</div>
</blockquote>
</td>
<td ALIGN="LEFT" VALIGN="MIDDLE" width="423"><div align="left"><p><font face="Verdana"><input
TYPE="TEXT" NAME="secondnumber" VALUE MAXLENGTH="20" SIZE="20"><input TYPE="SUBMIT"
NAME="submit" VALUE="Calculate"></font></td>
</tr>
</table>
</form>
<blockquote>
<b><p><font face="Verdana">Result: </b><%
dim clac
dim fristnumber
dim secondnumber
dim operation
fristnumber =Request("fristnumber")
secondnumber=Request("secondnumber")
If Request.Form("optConnSpeed").Count = 0 Then
else
set calc =server.createobject("ejb.oas:/CalcDemo/ServerCalc")
optConnSpeed= Request.Form("optConnSpeed")
GetName(optConnSpeed)
end if
Function GetName(value)
If value = "0" Then
GetName = "Add"
response.write(calc.add(fristnumber,secondnumber))
ElseIf value = "1" Then
GetName = "subtract"
response.write(calc.subtract(fristnumber,secondnumber))
ElseIf value = "2" Then
GetName = "multiply"
response.write(calc.multiply(fristnumber,secondnumber))
ElseIf value = "3" Then
GetName = "divide"
response.write(calc.divide(fristnumber,secondnumber))
End If
End Function
%> </font></p>
<p align="center"><font face="Verdana"><a href="http://www.halcyonsoft.com"><img
src="textlogo2.gif" align="bottom" width="133" border="0" height="45" bgcolor="#dddddd"></a></font></p>
</blockquote>
</blockquote>
</body>
</html>