'定义存储的结构体
Type ff
f1 As String
f2 As String
f3 As String
f4 As String
End Type
'以下是实现的主要功能代码
Dim count As Long
While Not rsEOF
count = count + 1
rsMoveNext
Wend
rsMoveFirst
Dim allRs(count) As ff
count = 0
While Not rsEOF
allRs(count)f1 = rsFields(0)
allRs(count)f2 = rsFields(0)
allRs(count)f3 = rsFields(0)
allRs(count)f4 = rsFields(0)
rsMoveNext
Wend
Function sumD(n As Integer) As Single
s = 1
i = 1
Do
i = i + 1
s = s + 1 / i
Loop Until i >= n
sumD = s
End Function
Function sumF(n As Integer) As Single
s = 0
For i = 1 To n
s = s + 1 / i
Next i
sumF = s
End Function
Private Sub Form_Click()
sum1 = sumD(100)
sum2 = sumF(100)
Print "sum1="; sum1
Print "sum2="; sum2
End Sub
运行结果是:
sum1=5187377
sum2=5187377
扩展资料:
不带输出项的print即为输出一个空行,如果之前的print语句输出项的最后用了诸如“,”或“;”,则表示其输出是在同一行上。其后面的空的print语句用来消除前面的print语句一直在同一行上输出的效果,使其后面的输出是在下一行。
如:Print()
二、print(DOS命令)
打印文本文件。
if textbox2text=男 then
if textbox3text>=60 then
label5text=是
else
label5text=否
endif
elseif textbox2text=女 then
if textbox4=工人 and TextBox3Text >= "50" Then
Label5Text = "是"
elseif textbox4 <>工人 and TextBox3Text >= "55" Then
Label5Text = "是"
else
label5text=否
endif
endif
大体是这样 我这没法调试
欢迎分享,转载请注明来源:浪漫分享网
评论列表(0条)