Rick,
Thanks for your thoughts, even though I still think that "elegant simplicity" (e.g., being able to put an entire working program into a single file which may serve as a useful teaching example) can be a noble goal.
Here's an improved Pause subroutine, which doesn't tie up the CPU in as wasteful a fashion:
Private Declare Sub Sleep Lib "kernel32" (ByVal _
dwMilliseconds As Long)
Dim gPause As Boolean
Sub Pause()
gPause = True
Do
Sleep 100
If gPause = False Then Exit Do
DoEvents
Loop
End Sub
Of course, you also have to disable temporarily the controls that you do not want the user to use, but that's not difficult to do. If controls are disabled, the user won't click on them (yes, I have given in to actually disabling them), and the Sleep command means that the loop doesn't eat up much CPU time.
Anyway, the Pause subroutine approach (including the Sleep command) seems to work fine (at least on the two machines I've tried it on so far, one running Windows ME and the other a slower machine running Windows 95).
By the way, I am willing to "go with the flow" when there is no reasonable alternative, but I do like to explore other possibilities off the beaten path (if I can mix some metaphors here).
Any decent programming language ought to allow a flexible combination of mudular programming and linear programming.
You say to me, "you want the program calling the shots, and limiting the user to a single course of action. That's inimical to Windows design, and that's why it's tough to do." And my reply is, "If that's true, so much the worse for Windows, if it is 'inimical' to 'limiting the user to a single course of action.' A program -- and a programmer -- ought to be free sometimes to 'call the shots,' because often straight-line development is the best way to go."
Thanks again for your thought-provoking comments. I'm still not convinced by what you say (but then again, I'm not a professional programmer -- I program primarily not for a living, but for fun).
Warm regards,
Barry