爱问知识人 爱问教育 医院库

为什么VB没有结果?

首页

为什么VB没有结果?

Dim a(1 To 10) As Integer
Dim i As Integer, j As Integer, t As Integer
For i = 1 To 10
a(i) = InputBox("输入第" & i & " 个数:", "数据输入", 0)
Next i
For i = 1 To 9
For j = i + 1 To 10
If a(i) < a(j) Then
t = a(i)
a(i) = a(j)
a(j) = t
End If
Next j
Next i
For i = 1 To 10
Form1.Print a(i), Tab(9)
Next i
为什么VB没有任何信息?

提交回答
好评回答
  • 2005-09-14 17:01:22
      用Msgbox吧,它是windows里的提示工具
    先在最上面加上一
    dim strMsg as string
    strmsg=""
    把 Form1。
      Print a(i), Tab(9) 改为 strmsg=strmsg & a(i) & tab(9) 然后在最后一行加上 msgbox strMsg 全程序如下: dim strMsg as string strMsg="" Dim a(1 To 10) As Integer Dim i As Integer, j As Integer, t As Integer For i = 1 To 10 a(i) = InputBox("输入第" & i & " 个数:", "数据输入", 0) Next i For i = 1 To 9 For j = i + 1 To 10 If a(i) < a(j) Then t = a(i) a(i) = a(j) a(j) = t End If Next j Next i For i = 1 To 10 strMsg=strMsg & a(i) & tab(9) Next i msgbox strMsg 可以了吗 。

    S***

    2005-09-14 17:01:22

其他答案

    2005-09-15 06:53:27
  • Form1.Print a(i), Tab(9)
    应该能打印东东出来,在Form1的最左边,有没有东西挡住了?但这样要好点:
    Form1.Print a(i);
    当然上面各位建议的Msgbox和debug.print都行,但最好不用Tab(),而a(i) &Tab(9)是错的,因为Tab()是个函数......
    

    1***

    2005-09-15 06:53:27

  • 2005-09-14 17:41:07
  • 只要把form1.print a(i),Tab(9) 改成form1.print a(i) &Tab(9)这样就可以

    云***

    2005-09-14 17:41:07

  • 2005-09-13 23:37:01
  • Form1.Print a(i), Tab(9)
    换为
    debug.print a(i),tab(9)
    运行后在立即窗体中看吧.

    天***

    2005-09-13 23:37:01

  • 2005-09-13 17:04:40
  • “For i = 1 To 10
      Form1.Print a(i), Tab(9)
      Next i”
    这一段中将“Form1.”去掉

    a***

    2005-09-13 17:04:40

类似问题

换一换
  • VB 相关知识

  • 电脑网络技术
  • 电脑网络

相关推荐

正在加载...

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 171-190
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):