The project looks good
Avoid this coding style though ...
Very inefficient. Suggest rethinking your schema using a "Select Case" structure. No need for the logical AND operator at all. Put your thinking cap on and you should be able to reduce the size of the code by half!Code:If (b1 <= 255 And b1 >= 243) Then timerN = 1 timerAc = 600 timerBc = 180 End If If (b1 <= 242 And b1 >= 219) Then timerN = 2 timerAc = 180 timerBc = 60 End If If (b1 <= 218 And b1 >= 193) Then timerN = 3 timerAc = 120 timerBc = 60 End If
Regards,
Trent Jackson
Already did...down to 38 lines. But since nobody else can read it, decided not to post it...and didn't use select case. Those numbers aren't linear, but they're close enough to do some math on to get the desired results...thereby resulting in a simple single if/then/endif 3-line statement to handle all those if/then's.
That's a shame Jeremy, I was going to expose you to the world as border line genius.
Last edited by T.Jackson; - 19th June 2008 at 17:37.
What
is
so
hard
to
read
with
colons
?
I
think
they
help
make
the
code
MORE
readable
if
used
in
the
right
place.
It
makes
it
more
like
reading
a
book.
![]()
Dave
Always wear safety glasses while programming.
Bookmarks