The Cellar  

Go Back   The Cellar > Main > Technology

Technology Computing, programming, science, electronics, telecommunications, etc.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 11-23-2010, 06:35 PM   #17
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
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 05:18 PM.


Powered by: vBulletin Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.