vb中显示format函数或子程序没有定义,如何解决。我就是对着坑爹的书本敲的,
PrivateSubform_Click()DimsAsStringDimflagAsBooleanDimxAsInteger,iAsInteger,cAsInteger...
Private Sub form_Click()
Dim s As String
Dim flag As Boolean
Dim x As Integer, i As Integer, c As Integer
Text1.Top = 0
Text1.Left = 0
Text1.Width = Form1.ScaleWidth
Text.Height = Form1.ScaleWidth
s = ""
s = s + String(18, "") + "1000以内的素数" + String(18, "")
s = s + vbCrLf
s = s + String(50, "-")
s = s + vbCrLf
For x = 1 To 100
flag = ture
For i = 2 To x \ 2 + 1
If x Mod i = 0 Then
flag = False
Exit For
End If
Next
If flag Then
s = s + fomat(x, "@@@")
c = c + 1
If c Mod 10 = 0 Then s = s + vbCrLf
End If
Next
Text1 = s
End Sub 展开
Dim s As String
Dim flag As Boolean
Dim x As Integer, i As Integer, c As Integer
Text1.Top = 0
Text1.Left = 0
Text1.Width = Form1.ScaleWidth
Text.Height = Form1.ScaleWidth
s = ""
s = s + String(18, "") + "1000以内的素数" + String(18, "")
s = s + vbCrLf
s = s + String(50, "-")
s = s + vbCrLf
For x = 1 To 100
flag = ture
For i = 2 To x \ 2 + 1
If x Mod i = 0 Then
flag = False
Exit For
End If
Next
If flag Then
s = s + fomat(x, "@@@")
c = c + 1
If c Mod 10 = 0 Then s = s + vbCrLf
End If
Next
Text1 = s
End Sub 展开
2个回答
展开全部
format
~~~~~~~~
~~~~~~~~
更多追问追答
追问
那如何定义它,程序是显示这里错了
追答
你少写一个字母,是format不是fomat,与定义没有关系。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
VBA.Format
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询