主题:工具的算法,程序已经完成
本人上个星期在发贴的工具的算法,目前程序已经完成。现把代码发出来分享:
Dim mytime '声明一个变量
Dim mydate
Dim months As Integer '当前提取到的月份
Dim day As Integer ' 当前提取到的日(号数)
Dim times As String '当前提取到的时间(小时)
Dim aaa As Integer '转换为数字的月,日,时的组合
Dim strdate As String '用于把当前系统日期的值班转换为字符串
Dim strday, strtimes, strmonths
Private Sub Command1_Click()
'获取当前系统时间
mytime = Now '给变量赋值为time函数(当前系统时间)
Text1.Text = Format(mytime, "HH:mm:ss") '将当前时间转换为数字并通过text1输出
''获取当前系统日期~
mydate = Date
strdate = Str(mydate) '将日期转换成字符,
Text2.Text = strdate
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'提取月份字符串
Text3.Text = Mid(strdate, 6, 2)
'提取当日字符串
Text4.Text = Mid(strdate, 9, 2)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
day = Val(Text4.Text) '当前提取到的日(号数)
months = Val(Text3.Text) '当前提取到的月份
strday = Str(Text4.Text)
strtimes = CStr(Text1.Text) '把时间强制转换为字符串
times = Mid(strtimes, 1, 2) ' 提取表示“时”的字符串
strmonths = Str(Text3.Text) '把提取到的月份转换成字符串
Text5.Text = Val(strmonths & strday & strtimes) '把月,日,时,连接成字符串
aaa = Text3.Text & Text4.Text & times '转换为数字的月,日,时的组合
Text7.Text = aaa
Text6.Text = 28 * months * day
Text8.Text = Val(aaa) * Val(Text6.Text)
End Sub
Private Sub Command2_Click()
End
End Sub
Dim mytime '声明一个变量
Dim mydate
Dim months As Integer '当前提取到的月份
Dim day As Integer ' 当前提取到的日(号数)
Dim times As String '当前提取到的时间(小时)
Dim aaa As Integer '转换为数字的月,日,时的组合
Dim strdate As String '用于把当前系统日期的值班转换为字符串
Dim strday, strtimes, strmonths
Private Sub Command1_Click()
'获取当前系统时间
mytime = Now '给变量赋值为time函数(当前系统时间)
Text1.Text = Format(mytime, "HH:mm:ss") '将当前时间转换为数字并通过text1输出
''获取当前系统日期~
mydate = Date
strdate = Str(mydate) '将日期转换成字符,
Text2.Text = strdate
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'提取月份字符串
Text3.Text = Mid(strdate, 6, 2)
'提取当日字符串
Text4.Text = Mid(strdate, 9, 2)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
day = Val(Text4.Text) '当前提取到的日(号数)
months = Val(Text3.Text) '当前提取到的月份
strday = Str(Text4.Text)
strtimes = CStr(Text1.Text) '把时间强制转换为字符串
times = Mid(strtimes, 1, 2) ' 提取表示“时”的字符串
strmonths = Str(Text3.Text) '把提取到的月份转换成字符串
Text5.Text = Val(strmonths & strday & strtimes) '把月,日,时,连接成字符串
aaa = Text3.Text & Text4.Text & times '转换为数字的月,日,时的组合
Text7.Text = aaa
Text6.Text = 28 * months * day
Text8.Text = Val(aaa) * Val(Text6.Text)
End Sub
Private Sub Command2_Click()
End
End Sub