View Single Post
Old 11-23-2010, 06:35 PM   #2
tw
Read? I only know how to write.
 
Join Date: Jan 2001
Posts: 11,933
Quote:
Originally Posted by Flint View Post
while !(a) or !(b)
{
if !(a)
call (a)

if !(b)
call (b)
}
Only reading the summary code: Are (a) and (b) a function or method? Or are each a property?

If (a) or (b) are functions: when a bad user name is entered in
while ( !(a) ....
That causes the while loop to drop to an 'If' condition. Then another
(a) function is executed.

Then the while loop again again executes (a) again:
while ( !(a) or !(b) )
Everytime (a) and (b) are executed - an new entry occurs. IOW what happened in "call (a)" gets replaced by another execution of "while ( !(a) ..."


To work, the code should read something like this:


do
{call (a)
if ((a).result == good)
{call (b)}
}
loop until ( (a).result == good and (b).result == good )


(a).result and (b).result are properties.
call(a) and call(b) are methods.

Summary code many not accurately reflect what your actual code does. But the difference between an executed function call(a) and its resulting property (a).result should be clearer. As I read the original summary code, everytime (a) is executed, a previous user name (good or bad) is erased and a new username is entered.
tw is offline   Reply With Quote