Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <HTML>
- <HEAD>
- <TITLE>Taschenrechner</TITLE>
- <HTA:APPLICATION
- APPLICATIONNAME="Taschenrechner"
- SINGLEINSTANCE="Yes"
- WINDOWSTATE="normal"
- BORDER="yes"
- MAXIMIZE="yes"
- CAPTION="Funktions-Demo: Ausgabe in Fenster"
- SHOWINTASKBAR="yes"
- SYSMENU="yes">
- <SCRIPT LANGUAGE="VBScript">
- Option Explicit
- Sub Voreinstellungen()
- ' Fenstergröße festlegen
- Window.resizeTo 540, 500
- End Sub
- Public Sub NummernTaste(Number)
- Select Case Formular.txtOperator.Value
- Case 0
- If Formular.txtDisplay.Value = "0" Then
- Formular.txtDisplay.Value = Number
- Else
- Formular.txtDisplay.Value = Formular.txtDisplay.Value & Number
- End If
- Case 8
- Formular.txtDisplay.Value = ""
- Formular.txtDisplay.Value = Formular.txtDisplay.Value & Number
- Formular.txtOperator.Value = 1
- Case 9
- Formular.txtDisplay.Value = ""
- Formular.txtDisplay.Value = Formular.txtDisplay.Value & Number
- Formular.txtOperator.Value = 2
- Case 10
- Formular.txtDisplay.Value = ""
- Formular.txtDisplay.Value = Formular.txtDisplay.Value & Number
- Formular.txtOperator.Value = 3
- Case 11
- Formular.txtDisplay.Value = ""
- Formular.txtDisplay.Value = Formular.txtDisplay.Value & Number
- Formular.txtOperator.Value = 4
- Case Else
- Formular.txtDisplay.Value = Formular.txtDisplay.Value & Number
- End Select
- End Sub
- Public Sub KommaTaste()
- If Instr(1,Formular.txtDisplay.Value,",") Then
- If Formular.txtOperator.Value > 7 Then
- Formular.txtDisplay.Value = ","
- Formular.txtOperator.Value = Formular.txtOperator.Value - 7
- End If
- Else
- Formular.txtDisplay.Value = Formular.txtDisplay.Value & ","
- End If
- End Sub
- Public Sub OperatorTaste(Number)
- On Error Resume Next
- Select Case Number
- Case 1
- Formular.txtValue.Value = Formular.txtDisplay.Value
- Formular.txtOperator.Value = 8
- Case 2
- Formular.txtValue.Value = Formular.txtDisplay.Value
- Formular.txtOperator.Value = 9
- Case 3
- Formular.txtValue.Value = Formular.txtDisplay.Value
- Formular.txtOperator.Value = 10
- Case 4
- Formular.txtValue.Value = Formular.txtDisplay.Value
- Formular.txtOperator.Value = 11
- Case 5
- If Left(Formular.txtDisplay.Value,1) = "-" Then
- Formular.txtDisplay.Value = Right(Formular.txtDisplay.Value,Len(Formular.txtDisplay.Value)-1)
- Else
- Formular.txtDisplay.Value = "-" & Formular.txtDisplay.Value
- End If
- Case 6
- 'c
- Formular.txtDisplay.Value = ""
- Formular.txtValue.Value = 0
- Formular.txtOperator.Value = 0
- Case 7
- '=
- Select Case Formular.txtOperator.Value
- Case 1
- Formular.txtDisplay.Value = cDbl(Formular.txtDisplay.Value) + cDbl(Formular.txtValue.Value)
- Case 2
- Formular.txtDisplay.Value = cDbl(Formular.txtValue.Value) - cDbl(Formular.txtDisplay.Value)
- Case 3
- Formular.txtDisplay.Value = cDbl(Formular.txtValue.Value) * cDbl(Formular.txtDisplay.Value)
- Case 4
- Formular.txtDisplay.Value = cDbl(Formular.txtValue.Value) / cDbl(Formular.txtDisplay.Value)
- Case Else
- Formular.txtDisplay.Value = Formular.txtValue.Value
- End Select
- case Else
- End Select
- End Sub
- </SCRIPT>
- <STYLE TYPE="text/css">
- H1, H2, H3 { font-family:Arial,Helvetica,sans-serif;color:lime;margin-top:12pt;margin-bottom:12pt}
- UL { list-style-type:circle }
- UL,OL,LI,P { margin-top:3pt;font-family:Verdana,Arial,Helvetica,sans-serif }
- TD,TH { margin-top:0pt}
- TH { background-color:#CECECE;font-size:9pt;font-weight:bold;line-height:11pt }
- BODY,P,DD,DL,DT { font-family:Verdana,Arial,Helvetica,sans-serif;color:lime;font-size:9pt;margin-top:3pt;margin-bottom:3pt }
- BODY { background:url("./hintergrund.gif")}
- A:LINK { color:blue }
- A:VISITED { color:red }
- A:ACTIVE { color:darkred }
- BLOCKQUOTE, TD { color:navy }
- B.Trenner { font-family:Arial,Helvetica,sans-serif;color:gray;font-size:16pt }
- .Marker { background-color:#FFFF80;font-weight:bold }
- INPUT { font-family: Arial, Helvetica, sans-serif;font-size: 13px;font-weight: bold;background-color: gray;color : Lime;border : 1 solid #CCCCCC; }
- </STYLE>
- </HEAD>
- <BODY ONLOAD="Voreinstellungen" STYLE="background-color:#101010">
- <H1>Taschenrechner</H1>
- <P>Dieses Beispiel stellt einen Kleinen Taschenrechner dar, es können die Grundrechnungsarten angewendet werden.</P>
- <HR NOSHADE>
- <FORM NAME="Formular" METHOD="Post" ENCTYPE="multipart/form-data">
- <TABLE BORDER="0" CELLPADDING="5" CELLSPACING="1" STYLE="width:450px;margin-top:50px">
- <TR VALIGN="TOP">
- <TD>
- <p>
- <INPUT TYPE="TEXT" NAME="txtDisplay" VALUE="" STYLE="width:139px" readonly>
- <INPUT TYPE="HIDDEN" NAME="txtValue" VALUE="0" STYLE="width:20px">
- <INPUT TYPE="HIDDEN" NAME="txtOperator" VALUE="0" STYLE="width:20px">
- </p>
- <INPUT TYPE="BUTTON" NAME="Ausgabe" VALUE="+" ONCLICK="OperatorTaste(1)" STYLE="width:30px">
- <INPUT TYPE="BUTTON" NAME="Ausgabe" VALUE="7" ONCLICK="NummernTaste(7)" STYLE="width:30px">
- <INPUT TYPE="BUTTON" NAME="Ausgabe" VALUE="8" ONCLICK="NummernTaste(8)" STYLE="width:30px">
- <INPUT TYPE="BUTTON" NAME="Ausgabe" VALUE="9" ONCLICK="NummernTaste(9)" STYLE="width:30px">
- <br>
- <INPUT TYPE="BUTTON" NAME="Ausgabe" VALUE="-" ONCLICK="OperatorTaste(2)" STYLE="width:30px">
- <INPUT TYPE="BUTTON" NAME="Ausgabe" VALUE="4" ONCLICK="NummernTaste(4)" STYLE="width:30px">
- <INPUT TYPE="BUTTON" NAME="Ausgabe" VALUE="5" ONCLICK="NummernTaste(5)" STYLE="width:30px">
- <INPUT TYPE="BUTTON" NAME="Ausgabe" VALUE="6" ONCLICK="NummernTaste(6)" STYLE="width:30px">
- <br>
- <INPUT TYPE="BUTTON" NAME="Ausgabe" VALUE="*" ONCLICK="OperatorTaste(3)" STYLE="width:30px">
- <INPUT TYPE="BUTTON" NAME="Ausgabe" VALUE="1" ONCLICK="NummernTaste(1)" STYLE="width:30px">
- <INPUT TYPE="BUTTON" NAME="Ausgabe" VALUE="2" ONCLICK="NummernTaste(2)" STYLE="width:30px">
- <INPUT TYPE="BUTTON" NAME="Ausgabe" VALUE="3" ONCLICK="NummernTaste(3)" STYLE="width:30px">
- <br>
- <INPUT TYPE="BUTTON" NAME="Ausgabe" VALUE="/" ONCLICK="OperatorTaste(4)" STYLE="width:30px">
- <INPUT TYPE="BUTTON" NAME="Ausgabe" VALUE="+/-" ONCLICK="OperatorTaste(5)" STYLE="width:30px">
- <INPUT TYPE="BUTTON" NAME="Ausgabe" VALUE="0" ONCLICK="NummernTaste(0)" STYLE="width:30px">
- <INPUT TYPE="BUTTON" NAME="Ausgabe" VALUE="," ONCLICK="KommaTaste()" STYLE="width:30px">
- </TD>
- </TR>
- <TR VALIGN="TOP">
- <TD>
- <INPUT TYPE="BUTTON" NAME="Ausgabe" VALUE="C" ONCLICK="OperatorTaste(6)" STYLE="width:66px">
- <INPUT TYPE="BUTTON" NAME="Ausgabe" VALUE="=" ONCLICK="OperatorTaste(7)" STYLE="width:66px">
- </TD>
- </TR>
- </TABLE>
- </FORM>
- <P><HR></P>
- <P ALIGN=CENTER>Stand: 03.08.2009 - Bitte alle Probleme melden!</P>
- </BODY>
- </HTML>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement