<m@simple.net> wrote
I have a question on a math loop and programming it in VB.net
Here's the logic:
While Num < 0.0998 And > .0801
Num / 2
Loop
Num / 11
I can get most of it but I'm having problems with the syntax and adding the "And" statement.
Always be as explicit as you can, (also be sure option Explicit is On)
While (Num < .0998) And (Num > .0801)
....
The comparison operators need values on both sides and the use
of parentheses avoids any ambiguity in what the evaluation order
should be.
Ex
2 * 5 + 7 = ?
(2 * 5) + 7 = 17
2 * (5 + 7) = 24
In the top (?) example the programmer has relied on VB to do the
right thing. Don't do that! Use parentheses to let everyone know
what the correct order of evaluation should be. The same goes
for your comparisons....
HTH
LFS