How to loop a loop in VBScript?

后端 未结 1 1566
萌比男神i
萌比男神i 2021-01-22 06:02

I am trying to know how to, or even know if it is possible to, loop inside a loop in VBScript.

Here is what logically world work:

Do until y=5
msgbox \"         


        
1条回答
  •  面向向阳花
    2021-01-22 06:23

    You need to initialize your variables:

    y = 0
    Do until y=5
        msgbox "msgbox 1 loop test " & y
        z = 0
        Do Until z=5
            msgbox "msgbox 2 loop test " & z
            z=z+1
        loop
        y=y+1
    loop
    

    Without z = 0 the second loop won't be entered after the first turn.

    0 讨论(0)
提交回复
热议问题