📄 commfunction.bas
字号:
Attribute VB_Name = "CommFunction"
Public Function getDate() As Integer
Dim flg, i, j As Integer
Dim s, e As String
While 1
StartDate = 0
EndDate = 20030116
flg = 0
s = InputBox(20020102, "开始日期:")
flg = 1
For i = 1 To Len(s)
If Mid(s, i, 1) < "0" Or Mid(s, i, 1) > "9" Then flg = 0
Next
If s <> "" And flg = 1 Then StartDate = CLng(s)
e = InputBox(20030102, "结束日期:")
flg = 1
For i = 1 To Len(e)
If Mid(e, i, 1) < "0" Or Mid(e, i, 1) > "9" Then flg = 0
Next
If e <> "" And flg = 1 Then EndDate = CLng(e)
flg = MsgBox("是否对" + CStr(StartDate) + "到" + CStr(EndDate) + "时期的股票进行研究", vbOKCancel)
If flg = 1 Or (s = "" And e = "") Then GoTo myOut
Wend
myOut:
End Function
Public Function getPrice() As Integer
Dim flg, i, j As Integer
Dim s, e As String
While 1
LowPrice = 0
TopPrice = 100000
flg = 0
s = InputBox(0, "最低价位:")
flg = 1
For i = 1 To Len(s)
If Mid(s, i, 1) < "0" Or Mid(s, i, 1) > "9" Then flg = 0
Next
If s <> "" And flg = 1 Then LowPrice = CLng(s)
e = InputBox("1000.00元", "最高价位:")
flg = 1
For i = 1 To Len(e)
If Mid(e, i, 1) < "0" Or Mid(e, i, 1) > "9" Then flg = 0
Next
If e <> "" And flg = 1 Then TopPrice = CLng(e)
flg = MsgBox("是否对" + CStr(LowPrice) + "到" + CStr(TopPrice) + "价位的股票进行研究", vbOKCancel)
If flg = 1 Or (s = "" And e = "") Then GoTo myOut
Wend
myOut:
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -