May I suggest you buy a good VB6 book? Too much to explain here ;-)
However:
1. a Timer is a control you put on a form from the tool box. You can change its action rate (property Window: Interval: in milliseconds). The active Timer will execute the code you wrote every "Interval" (code written by double-clicking on it in design mode).
2. The Form_Load event will occur every time you make the form load (and show). It's used to initialise some variables or to fill some controls like Listbox etc. before the user can change, type or select anything.
3. Do ... while should always be ended by the "Loop" statement. All code written between will be executed as long as the condition is not met.
As an example:
Dim sDate as Date
Do while sDate<>"09/09/2001"
If "I'm a fool" then 'or any relevant condition
sDate="09/09/2001" 'this will stop the looping
Endif
Loop
Got it?
4. Select Case is used every time only one out of several conditions is met:
Sample code:
Dim s as String
Select Case s
Case "a" 'if the s-string = "a"
Debug.Print "you son of a b..."
Case "b" 'if the s-string = "b"
Debug.Print "you fool"
Case "c" 'if the s-string = "c"
Debug.Print "you're Superman (at last)!"
End Case
Remember: only ONE condition and its code (Debug.Print) is executed (the first that meets the correct condition).
*************
For other code explanation, select a valid code word in VB (by double clicking on it), and press F1 to call the VB6 Help.
Good luck.
Vincent
need more help?
contact me at: vincent.mairiaux@yucom.be
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.