#2 had nothing to do with the statements being swapped.  Think through your
logic.  To put it in simpler terms, ((a < 3) AND (a > 5)) will NEVER be TRUE
because there is no way that "a" can be less than 3 AND greater than 5.
What I have done here is the same thing that you have done in your IF
statement.

#3, sleep() is VERY bad because Windows programs are event driven, NOT time
driven.  You have to examine why you want to sleep().  From your comments,
it looks like you are waiting for something to occur.  Be aware that if your
program is run on a machine that is running slower than you had in
development, the event that you are waiting for may not occur until after
your sleep() has expired.  Therefore, you should determine what the event
will be and write an event handler to do the processing when it occurs.
This way you will be sure that the correct processing is taking place.

...Glenn

On Thu, Nov 6, 2008 at 7:11 PM, Gotrek65 <[EMAIL PROTECTED]> wrote:

>
> 1st
> good point on the if elseif, should be a else since it only has 2
> options.
> 2nd
> why will it never be executed? oh I see what I messed up there the and
> or statements are swapped, the needs to be in the if statement and the
> or needs to be in the else statement
> 3rd
> Why is sleep bad? I've eliminated all but one of the large variable
> sleeps. Yes granted the sleep times shouldn't need to be put into the
> loops.
> 4th
> I think I got what you ment by constants, your absolutely right the
> constants(like my ranges and non changing numbers) should be up in the
> declarations so they can be called like the others
>
>
>

Reply via email to