|
发表于 2018-4-12 21:09:53
|
显示全部楼层
源码: - '----------Start-------------
- Sub main()
- Dim ans,a,b,L,week,pi
- Dim LL(1000), save_list,rev_list
- Dim info, info1
-
- Set Ws=CreateObject("Wscript.Shell")
-
-
-
- info="可用 乘号:* 加号:+ 减号:- 乘方:∧" & vbCrLf & vbCrLf & "三角函数:sin(),cos(),tan(),atn()" & vbCrLf & vbCrLf & "圆周率 Pi、星期 wek, L、P 遍历算式"
-
- pi=4*Atn(1)
- '输入wek可用于查看今日之星期
- Execute "wek=weekdayname(weekday(now))"
-
- ans = "Tan(355/226)"
- crlf = String(2, vbCrLf)
- On Error Resume Next
-
-
-
- Do
-
-
- L="L=" & Chr(34) & b & Chr(34)
-
-
- Execute l
-
- Select Case l
-
- Case "L","l"
- '向前翻时的操作
-
- rev_list=rev_list+1
- If save_list-rev_list >0 Then
- l=ll( save_list-rev_list)
- Else
- l=ll( 0)
- End If
-
- Case "p","P"
- '向后翻时的操作
-
- rev_list=rev_list-1
-
- ans=ll( save_list-rev_list+1)
-
-
-
- Case Else
-
-
- ll(save_list)=l
- save_list=save_list+1
- rev_list=1
- RunPath="MsHta vbscript:ClipBoardData.SetData(""Text"",""" & ans & """)(Window.Close)"
- Ws.Run(RunPath)
-
-
-
- End Select
-
- info1= vbCrLf & "当前算式位置 " & save_list-rev_list & " " & "算式数目总计 " & save_list-1
-
-
- Do
-
- a = InputBox(info & crlf & a & info1 , "文本计算器", ans,13000,7800)
-
- If InStr("exit",LCase(a) )<> 0 Then
- If a<>"" Then Exit Sub
- End If
-
-
- Loop Until a<>False Or a<>""
-
-
- b=a
- a = "Ans = " & a
-
- Execute a
-
-
-
- If Err.Number Then
- ans = Err.Description & "(请重新输入)"
- Err.Clear
- Else
- End If
- Loop
- End Sub
- Call main
- '-----------End--------------
复制代码
|
|