Dim a(100) As Double
Dim n&
Dim Plus As Boolean
Dim yunsuan(100) As Integer
Dim a100 As Double
Private Sub cmd1_Click()
If Plus = True Then
Plus = False
Text1.Text = "1"
Else
Text1.Text = Text1.Text & "1"
End If
End Sub
Private Sub cmdDian_Click()
If Plus = True Then
Plus = False
Text1.Text = "0."
Else
Text1.Text = Text1.Text & "."
End If
End Sub
Private Sub cmdjia_Click()
If Plus = False Then
a(n) = Val(Text1.Text)
yunsuan(n) = 0
n = n + 1
Plus = True
End If
End Sub
Private Sub cmdjian_Click()
If Plus = False Then
a(n) = Val(Text1.Text)
yunsuan(n) = 1
n = n + 1
Plus = True
End If
End Sub
Private Sub cmdcheng_Click()
If Plus = False Then
a(n) = Val(Text1.Text)
yunsuan(n) = 2
n = n + 1
Plus = True
End If
End Sub
Private Sub cmdchu_Click()
If Plus = False Then
a(n) = Val(Text1.Text)
yunsuan(n) = 3
n = n + 1
Plus = True
End If
End Sub
Private Sub cmdDengyu_Click()
If Plus = False Then
a(n) = Val(Text1.Text)
End If
a(100) = a(0) '初始为a(0)
For i = 1 To 99
If yunsuan(i - 1) = 0 Then
a(100) = a(100) + a(i)
ElseIf yunsuan(i - 1) = 1 Then
a(100) = a(100) - a(i)
ElseIf yunsuan(i - 1) = 2 Then
a(100) = a(100) * a(i)
ElseIf yunsuan(i - 1) = 3 Then
a(100) = a(100) / a(i)
End If
Next
Plus = False
Text1.Text = a(100)
n = 0
a100 = a(100)
Erase a
a(0) = a100
Erase yunsuan
End Sub
Private Sub Command13_Click()
End Sub
Private Sub Command17_Click()
Text1.Text = ""
Erase a
Erase yunsuan
n = 0
End Sub
Private Sub Form_Load()
Text1.Locked = True
n = 0
Plus = False
End Sub
Private Sub form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 97 Then cmd1_Click
If KeyCode = 98 Then cmd2_Click
If KeyCode = 99 Then cmd3_Click
If KeyCode = 100 Then cmd4_Click
If KeyCode = 101 Then cmd5_Click
If KeyCode = 102 Then cmd6_Click
If KeyCode = 103 Then cmd7_Click
If KeyCode = 104 Then cmd8_Click
If KeyCode = 105 Then cmd9_Click
If KeyCode = 96 Then cmd0_Click
If KeyCode = 110 Then cmdDian_Click
If KeyCode = 109 Then cmdjian_Click
If KeyCode = 13 Then cmdDengyu_Click
If KeyCode = 111 Then cmdchu_Click
If KeyCode = 107 Then cmdjia_Click
If KeyCode = 106 Then cmdcheng_Click
Debug.Print KeyCode, vbKey1
End Sub
只要帮我翻译几句就OK了!谢谢!
Dim a(100) As Double
Dim n&
Dim Plus As Boolean
Dim yunsuan(100) As Integer
Dim a100 As Double
If Plus = True Then
Plus = False
Text1.Text = "1"
Else
Text1.Text = Text1.Text & "1"
End If
End Sub
谁能帮我翻译下这段VB程序代码,就是讲下这段语句怎么编写的每句都什么...
你这个是用if语句不断嵌套,可读性不高。建议是用select case ind 应该是判断加减乘除的。这段程序通过判断ind值,来判断究竟采取哪种运算。Private Sub Command2_Click(indexAs Integer)If opnre = 0 Or index = 4 Then 如果opnre=0或index=4,那么 If ind = 0 Then 判断ind,如果ind=...
帮忙翻译一下VB代码(加点注释)
Private Sub winsockclient_DataArrival(ByVal bytesTotal As Long)Dim tmpstr As String \/\/声明一个文本变量用于下面接收文本用 Winsockclient.GetData tmpstr \/\/接收文本 Textget.Text = tmpstr \/\/显示在textget中 End Sub 这是接收端 Private Sub Command1_Click()End End Sub Private Sub Command...
帮忙翻译一下VB代码(加点注释)
Private Sub Command1_Click() '按钮1点击事件 End '退出程序 End Sub Private Sub Form_Load() '主窗口启动事件 textsend.Visible = False 'textsend是文本框控件吧,把它设为不可见 textget.Visible = False '同上,textget设为不可见 Winsockserver.LocalPort = 1001 'Winsockserver是你添加的w...
翻译一小段VBA程序代码(估计和VB差不多吧)
Dim stDocName As String '定义一个字符串型变量 stDocName = ChrW(22995) & ChrW(21517) '把这个变量赋值为“姓名”DoCmd.OpenReport stDocName, acPreview '打开“姓名”的记录 Exit_Command43_Click: '标签 Exit Sub '结束子过程 Err_Command43_Click: '标签 MsgBox Err.Description' 提示出...
翻译一段VB代码 着急啊 谢谢各位中国人 每句什么意思备注一下...
MsgBox "用户名称不能为空!", vbOKOnly, "提示"Text1(0).SetFocus Exit Sub End If 看得出,text1(0)是用来输入用户名称的,如果=空白那就叫你再输入,退出这个过程,下面的基本同你能看懂的。一直到 txtSQL = "select * from user_Form where user_ID='" & Trim(Text1(0)) & "'"S...
帮忙逐句翻译这段Excel VBA代码的详细意思
Application.EnableEvents = False \/\/这个是禁用触发事件(防止重复触发)Application.ScreenUpdating = False\/\/禁用屏幕刷新 path = MyDir \/\/简单的赋值语句 FileName = Dir(path & "\\*.xls", vbNormal)\/\/简单的赋值语句\\(调用了Dir方法 ,为FileName 赋值)Do Until FileName = "" \/\/循环直到File...
翻译一小段VBA程序代码(估计和VB差不多吧)
DoCmd.Close acReport, "会员详细信息" '关闭"会员详细信息"窗口 Dim stDocName As String stDocName = ChrW(20250) & ChrW(21592) & ChrW(-29722) & ChrW(32454) & ChrW(20449) & ChrW(24687)'为stDocName赋值 '上句等价于 stDocName ="会员详细信息",ChrW(20250)等分别代表一个汉字 ...
请教一段VB程序代码翻译
这就是一段条码扫描程序 分别扫入a和s条码,判断条码长度和条码头,如果有错误,则报警,并提示再次输入,否则就把条码写入excel表,并提示输入下一个条码。MMWarn.FileName = App.Path & "\\HOOK1.WAV"'设置MMC播放器要播放的音频文件,这里设置为"hook.wav"End Sub Private Sub txtBodyNo_Key...
麻烦翻译下这段VB的编码。必须通俗,专业用语看不懂的。。求计算机大爷回...
a=2 【给变量a赋值2。这里由程序给变量a赋了值,因此点击按钮后,就不用你人工输入了。】For i = 1 To 2 【i是循环变量。VB中的变量允许不事先说明。】Print Fun(a) 【输出函数Fun(a)的值,i的值为1时输出1遍函数运算的值,i增长到2时再输出1遍,然后结束循环。】【第一编循...
翻译vb一段代码?
这段程序的功能是把360程序设置为开机自动运行。详解如下:=== Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long Private Declare Function RegSetValueEx Lib "advapi32.dll" ...