![]() |
Code Explenation & A Little Help
So in our class now, we will be making a screen saver.
I wasn't there Monday - Friday and Tuesday needed to finish a project from those few days so I wasn't totally able to pay 100% attention. I'm just wondering if someone can read the code I have now (he posted it, just without explanations though) and help me out by telling me what each line is doing? :
Option ExplicitWhat I'm really having more of a problem with is the For To Step, like the "For sngY = Me.Height - sngChange - 380 To sngChange Step -1". The end result when Run is pressed looks like this: http://img108.imageshack.us/img108/4223/37116248tp8.jpg And finally, we need to make a code to have a line bounce off the screen and change colors. I have it doing that, know how to do the colors (Have the "PSet (sngX, sngY) , sngColors" and sngColors = White under each If Then statement), but I don't know what the last like needs to be to get it to stop after so long or at a certain point. Here is what I have so far though: :
Option ExplicitI tend to stay away from one-on-one after class because last time I tried that I was more confused after it was done. |
Re: Code Explenation & A Little Help
The for statement has two or three elements (yours has two). The first element defines a beginning value. The second defines an ending value. The loop will be executed for the number of times it takes to move from the first value through the second value, incrementing by one (or until an explicit exit is commanded).
I say "incrementing by one" because that is the default increment. If there is a third element present, it will define the increment ("step", as it's called). You seem to have missed more than a few days, or were otherwise occupied picking your nose when the basics were taught. That's lamentable, I suppose. You might find someone willing to explain each and every line of the code to you, but don't hold your breath. Just sayin'. |
| All times are GMT -5. The time now is 3:28 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC