VBEval.htm 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  5. <meta name="generator" content="PSPad editor, www.pspad.com">
  6. <style>
  7. body {font-family: Verdana,Tahoma; font-size: 9pt; font-weight: normal;}
  8. table {font-family: Verdana,Tahoma; font-size: 9pt; font-weight: normal;}
  9. input {font-family: Verdana,Tahoma; font-size: 10pt; font-weight: normal; border: 1px solid;}
  10. textarea {font-family: Verdana,Tahoma; font-size: 10pt; font-weight: normal; border: 1px solid;}
  11. button {font-family: Verdana,Tahoma; font-size: 8pt; font-weight: bold; width: 125px; height: 24px;}
  12. </style>
  13. <title>VB Eval</title>
  14. <script language="vbscript">
  15. Sub Calculate()
  16. Dim frm
  17. Dim strExp
  18. Dim strResult
  19. Set frm = document.frmMain
  20. strExp = frm.txtExp.Value
  21. strResult = Eval(strExp)
  22. frm.txtResult.Value = strResult
  23. End Sub
  24. </script>
  25. </head>
  26. <body>
  27. <form name="frmMain" id="frmMain" method="POST">
  28. <table>
  29. <tr>
  30. <td>Expression : </td>
  31. <td><input type="text" size="50" name="txtExp" id="txtExp" /></td>
  32. </tr>
  33. <tr>
  34. <td colspan="2">
  35. <textarea name="txtResult" id="txtResult" cols="61" rows="5"></textarea>
  36. </td>
  37. </tr>
  38. <tr>
  39. <td colspan="2" align ="center">
  40. <button name="btnCalc" id="btnCalc" onClick="vbscript:Calculate()">Calculate</button>
  41. </td>
  42. </tr>
  43. </table>
  44. </form>
  45. </body>
  46. </html>