Link to home
Start Free TrialLog in
Avatar of daky
dakyFlag for Croatia

asked on

Do Loop example

How to make do-loop in vb? I heared that using doloop circles crashes windows :) So, how to do that?
ASKER CERTIFIED SOLUTION
Avatar of EstebanFG
EstebanFG

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of daky

ASKER

Yes it works but it should be * instead of + at
 
Do While x < 5
x = x * 1          'it was +

and my Windows almost dodge it :) Thats why not A graded
Daky, the changes you suggest making to the code make no sense.  Multiplying a number by itself gives the same number (or in this case zero, since that is the starting value of x.)  You asked for an example of a Do loop (why I don't know because it is documented adequately in the online help) then when you get a perfectly good example, you make a nonsensical change to the code (resulting in an infinite loop, which won't crash your computer but will make your program useless and require Ctrl-Alt-Delete to fix) and then you grade EstebanFG with a B.  Why, because he cannot read your mind?
Avatar of daky

ASKER

I don't really know. But when I run what he says, I just get msgbox 5. I press ok, and then nothing happen. I just want to make program which will 100% crash someone computer. First it opens 100 command prompts, and then it loop infinitley, so ctrl-alt-delete wont help. Good idea, isn't it?

Cheers,
daky
Avatar of EstebanFG
EstebanFG

If i would've known that what you wanted was to crash someone's computer, instead of avoiding crashing (like most people would), they I would've given you some other example. (ie. shelling thousands of instances of command prompt might do it, depending on the operating system).

oh well, thanks for the B!