Non. VBScript existe aussi, et ce en local.
< SCRIPT LANGUAGE="VBScript">
< !--
Dim Operand ´ operand waiting for operation
Dim NewNum ´ Flag indicating a new operand is being entered
Dim Oper ´ Pending operation
sub PressKey(Byval Num)
If NewNum Then
Document.calc.display.value = Num
NewNum = False
Else
If Document.calc.display.value = " 0" Then
Document.calc.display.value = CStr(Num)
Else
Document.calc.display.value = Document.calc.display.value & CStr(Num)
End If
End If
end sub
sub Decimal_onClick()
Dim cv ´ Current value
cv = Document.calc.display.value
If NewNum Then
cv = " 0."
NewNum = False
Else
If instr(cv, " .") = 0 Then
cv = cv & " ."
End If
End If
Document.calc.display.value = cv
end sub
sub calculate(ByVal Op)
Dim cd ´ Current display
cd = Document.calc.display.value
If NewNum And Op < > " =" Then
´ User is hitting op keys repeatedly, so don´t do anything
Else
NewNum = True
Select Case oper
Case " +"
Operand = CDbl(Operand) + CDbl(cd)
Case " -"
Operand = CDbl(Operand) - CDbl(cd)
Case " /"
Operand = CDbl(Operand) / CDbl(cd)
Case " *"
Operand = CDbl(Operand) * CDbl(cd)
Case Else
Operand = cd
End Select
Document.calc.display.value = Operand
oper = Op
End If
end sub
sub ClearEntry_onClick()
Document.calc.display.value = " 0"
NewNum = True
end sub
sub Clear_onClick()
Operand = 0
oper = " "
ClearEntry_onClick
end sub
sub Neg_onClick()
Document.calc.display.value = -1 * CDbl(Document.calc.display.value)
end sub
sub Percent_onClick()
Document.calc.display.value = ( CDbl(Document.calc.display.value) / 100) * Operand
end sub
-->
< /SCRIPT>
Code provenant du livre de Peter Aitken " Guide de JavaScript et VBScript" chez ITP ( ISBN 2-84180-145-4)