Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Walking Image Project Required (Must be Basic !!!)

Status
Not open for further replies.

julie29

MIS
Aug 15, 2001
1
GB
I need to pratice using the x & y properties and the timer etc... I am very new to vb, soooooooo if you can help just a basic project.

What is the importance of writing code in Form Load?
What is the difference between the Do...While & Select Case statement?

Thankyou
 
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<>&quot;09/09/2001&quot;
If &quot;I'm a fool&quot; then 'or any relevant condition
sDate=&quot;09/09/2001&quot; '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 &quot;a&quot; 'if the s-string = &quot;a&quot;
Debug.Print &quot;you son of a b...&quot;
Case &quot;b&quot; 'if the s-string = &quot;b&quot;
Debug.Print &quot;you fool&quot;
Case &quot;c&quot; 'if the s-string = &quot;c&quot;
Debug.Print &quot;you're Superman (at last)!&quot;
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


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top