Código fuente de 'Calculadora.asp'
<html>
<html>
<head>
<title>Calculadora - Códigos asp, programacion asp, descargas asp, rutinas asp</title>
<%
'**************************************
' Name: Calculator
' Description:Show the Math Capabilities
' of VBScript
' By: martin castañeda
'
'This code is copyrighted and has ' limited warranties.Please see
'http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=6078&lngWId=4 'for details. '**************************************
%>
<CENTER>
<b>
<FONT face="Arial" size="3">Calculadora<BR></FONT>
</b><br>
<TABLE border=7 width="211">
<TR>
<TD colspan=3 align=middle><INPUT name=display size=22></TD>
</TR>
<TR>
<TD width="52"><INPUT type=button name=one value=" 1 "></TD>
<TD width="91" align="center"><INPUT type=button name=two value=" 2 "></TD>
<TD width="34" align="right"><INPUT type=button name=three value=" 3 "></TD>
</TR>
<TR>
<TD width="52"><INPUT type=button name=four value=" 4 "></TD>
<TD width="91" align="center"><INPUT type=button name=five value=" 5 "></TD>
<TD width="34" align="right"><INPUT type=button name=six value=" 6 "></TD>
</TR>
<TR>
<TD width="52"><INPUT type=button name=seven value=" 7 "></TD>
<TD width="91" align="center"><INPUT type=button name=eight value=" 8 "></TD>
<TD width="34" align="right"><INPUT type=button name=nine value=" 9 "></TD>
</TR>
<TR>
<TD width="52"></TD>
<TD width="91" align="center"><INPUT type=button name=zero value=" 0 "></TD>
<TD width="34" align="right"></TD>
</TR>
<TR>
<TD width="52"><INPUT type=button name=point value=" . "></TD>
<TD width="91" align="center"><INPUT type=button name=plus value=" + "></TD>
<TD width="34" align="right"><INPUT type=button name=minus value=" - "></TD>
</TR>
<TR>
<TD width="52"><INPUT type=button name=multiply value=" x "></TD>
<TD width="91" align="center"><INPUT type=button name=divide value=" / "></TD>
<TD width="34" align="right"><INPUT type=button name=equals value=" = "></TD>
</TR>
<TR>
<TD width="52"></TD>
<TD width="91"><INPUT type=button name=reset value=" borrar"></TD>
<TD width="34"></TD>
</TR>
</TABLE>
<BR>
<A href=index.htm>VBScript Calculator Created by Martin Castañeda</font></A>
</FONT>
</font>
</CENTER>
<SCRIPT language=vbscript>
<!--
Dim operator
Dim buffer
Sub one_onclick
display.value = display.value + "1"
End Sub
Sub two_onclick
display.value = display.value + "2"
End Sub
Sub three_onclick
display.value = display.value + "3"
End Sub
Sub four_onclick
display.value = display.value + "4"
End Sub
Sub five_onclick
display.value = display.value + "5"
End Sub
Sub six_onclick
display.value = display.value + "6"
End Sub
Sub seven_onclick
display.value = display.value + "7"
End Sub
Sub eight_onclick
display.value = display.value + "8"
End Sub
Sub nine_onclick
display.value = display.value + "9"
End Sub
Sub zero_onclick
display.value = display.value + "0"
End Sub
Sub point_onclick
display.value = display.value + "."
End Sub
Sub plus_onclick
call determine
operator="plus"
display.value=""
End Sub
Sub minus_onclick
call determine
operator="minus"
display.value=""
End Sub
Sub multiply_onclick
call determine
operator="multiply"
display.value=""
End Sub
Sub divide_onclick
call determine
operator="divide"
display.value=""
End Sub
Sub equals_onclick
call determine
operator=""
display.value=buffer
End Sub
Sub reset_onclick
call initialize
End Sub
Sub initialize
buffer=""
operator=""
display.value=""
End Sub
Sub determine
Dim result
if Not isnumeric(display.value) Then display.value="0"
if Not isnumeric(buffer) Then buffer="0"
if operator="" Then result=csng(display.value)
if operator="plus" Then result = csng(buffer) + csng(display.value)
if operator="minus" Then result = csng(buffer) - csng(display.value)
if operator="multiply" Then result = csng(buffer) * csng(display.value)
if operator="divide" Then result = csng(buffer) / csng(display.value)
buffer=result
End Sub
-->
</SCRIPT>
</HTML>