“Do While” “Loop” and “While” “Wend” Loop. What's the difference?

前端 未结 3 1634
無奈伤痛
無奈伤痛 2020-12-08 20:07

Reading some answers in stackoverflow I saw a while wend loop. I\'m used to the do while loop, so I was wondering what wo

3条回答
  •  猫巷女王i
    2020-12-08 20:50

    In fact, you don´t need "DO WHILE" since you may "DO-LOOP" without "While".

    I utilize "DO LOOP" if I need to perform an action at least one time (or several times) with no implicit condition, as the WHILE-WEND forces.

    Just for an instance, a kind of alarm clock:

      Do
        Display Time at screen
        Sounds a buzz
        if user confirm
           exit do
        end if
      Loop
    

提交回复
热议问题