vb循环嵌套,请高手做下

来源:百度知道 编辑:UC知道 时间:2024/06/06 04:23:47
判断条件 1 真
执行 a

执行h

在h执行当中
想+入 判断2
如果真停止h
执行b
否执行h

在在h执行当中
+入判断3
真停止 h
执行c,
否执行h

最后循环起来
VBScript

If 条件1真执行a

Else
Goto h

EndIf

rem h 。。。。。。。。。。。

h 运行呢。。。。

当条件
if 条件2真则停止h
goto b
Else
goto h
endif

h 运行呢。。。
条件if 3真 则停止h
goto c
else
goto h

保证 h 一直运行,
在当中检查条件 满足
1 或2或3.时候则停止h 运行
1,2,3
然后在运行h

私聊告诉你!

按你上面所述用语句表示就是如下:
if 条件1=true then
A过程
elseif 条件2=true then
B过程
elseif 条件3=true then
C过程
else
H过程
end if
看不出循环,如果有循环可以在if ... then语句外加循环语句。
===========================================
h过程一直处于运行中可以用时钟来控制
private sub timer1_timer()
h()
end sub
sub h()
if 条件1=true then
timer1.enable=false
A过程
elseif 条件2=true then
timer1.enable=false
B过程
elseif 条件3=true then
timer1.enable=false
C过程
else
H过程
end if
end sub

你是想要这样的么?
Private Sub Form_Load()
h:
...... 'h部分的程序
If 条件1 = 真 Then
GoTo 1
ElseIf 条件2 = 真 Then
GoTo 2
ElseIf 条件3 = 真 Then
GoTo 3
Else
GoTo h
End If

1:
... '满足条件1部分的程序
GoTo h '执行完后返回h部分

2:
... '满足条件2部分的程序