关于一道简单的VB题目。

来源:百度知道 编辑:UC知道 时间:2024/05/24 13:53:12
执行以下程序语句,程序在窗体上的输出为:_________

Dim Str As String*6 Const Str1 String="The Demo" Str="Visual Basic" Print Str Str="Basic" Print Str1+""+Str

Private Sub Command1_Click()
Dim Str As String * 6
Const Str1 As String = "The Demo"
Str = "Visual Basic"
Print Str
Str = "Basic"
Print Str1 + "" + Str
End Sub
答案
Visual
The DemoVisual
楼上的错了哦!!
str限制字符长度为6哦 (Dim Str As String * 6)

语句错误

看不懂

输出两行分别是
Visual
The DemoBasic

看不明白

原题应该是:

Private Sub Command1_Click()
Dim Str As String * 6
Const Str1 As String = "The Demo"
Str = "Visual Basic"
Print Str; Str = "Basic"
Print Str1 + "" + Str
End Sub

输出结果应该是:
VisualFalse
The DemoVisual