📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text2
Height = 855
Left = 480
TabIndex = 2
Text = "Text2"
Top = 1800
Width = 2295
End
Begin VB.TextBox Text1
Height = 1095
Left = 480
TabIndex = 1
Text = "Text1"
Top = 240
Width = 3495
End
Begin VB.CommandButton Command1
Caption = "计算"
Height = 495
Left = 3360
TabIndex = 0
Top = 2040
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'注意VB里数据长度与vc的区别,在声明里要体现出来,调用方法其实与调用API一样
Private Declare Function STDsetfornum Lib "e:\wl\forcaldll.dll" (ByVal m As Long) As Boolean
Private Declare Function STDrcal Lib "e:\wl\forcaldll.dll" (ByVal m As Long, ByRef a As Double) As Double
Private Declare Function STDrcom Lib "e:\wl\forcaldll.dll" (ByVal m As Long, ByVal a As String, ByRef n As Long) As Long
Private Declare Sub STDfreedll Lib "e:\wl\forcaldll.dll" ()
Private Sub Command1_Click()
Dim d(100) As Double
Dim a As String
Dim rtnval_a As Long
Dim x, i As Integer
a = Text1.Text
If a = "" Then
Text1.Text = "请在此输入表达式!"
Else
If STDsetfornum(1&) Then
If STDrcom(0&, a, rtnval_a) = 0 Then
For i = 0 To rtnval_a + 2
d(i) = 5
Next i
Text2.Text = STDrcal(0&, d(0))
Else
Text2.Text = "语法错误!"
End If
STDfreedll
End If
End If
End Sub
Private Sub Form_Load()
Text1.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -