大家看看我的代码,看哪错了,该怎么改谢谢了编译时老是提示“实时错误‘9’下标越界”怎么回事呀,但是有一次两才还能运行,看看,告诉我。我感激不尽
Private Sub Command1_Click()
Text2.Text = ""
Dim tou As String
tou = "push ebp" & vbNewLine & "mov ebp esp" & vbNewLine
Dim n As Integer
Dim h(1 To 4) As String
h(1) = "push eax" & vbNewLine & "pop eax" & vbNewLine
h(2) = "inc ecx" & vbNewLine & "dec ecx" & vbNewLine
h(3) = "nop" & vbNewLine & "nop" & vbNewLine
h(4) = "add esp ,58" & vbNewLine & "sub esp ,58" & vbNewLine
If Text1.Text <= 1 Then
Text1.Text = 7
End If
Dim a, b As String
For n = 1 To Text1.Text
a = h(Int(4 * Rnd)) '总提示出错,这里错哪了,该怎么改,还是别的地方错了
b = b & a '还有这里
Next n
Dim js(1 To 4) As String
js(1) = "jmp 跳回入口点"
js(2) = "je 跳回入口点" & vbNewLine & "jne 跳回入口点"
js(3) = "ja 跳回入口点" & vbNewLine & "jb 跳回入口点"
js(4) = "jz 跳回入口点" & vbNewLine & "jnz 跳回入口点"
Dim c, d As String
c = js(Int(4 * Rnd)) '总提示出错,这里错哪了,该怎么改,还是别的地方错了
d = d & c '还有这里
Text2.Text = tou & b & d
End Sub
[此贴子已经被作者于2007-8-10 18:07:32编辑过]