Click to See Complete Forum and Search --> : [RESOLVED] Check 2 boolean values in return
Y.P.Y
Oct 20th, 2008, 01:31 PM
_______________________________
kfcSmitty
Oct 20th, 2008, 02:58 PM
Maybe I don't really understand what you mean, but why don't you just multiply the values together?
The only way the function will return true is if both are true.
visualAd
Oct 20th, 2008, 04:08 PM
return $this->_Bln_QueryExcuted && $this->_Bln_RowsAffected
The result of the && operation is always a boolean. Therefore you just need to return that.
Y.P.Y
Oct 21st, 2008, 02:10 AM
Thanks VisualAd. ;)
Also what is difference between:
return($_X ? $_Y= fale : $_Y= true) V.S. return($_X) ? $_Y= fale : $_Y= true;
Regards.
penagate
Oct 22nd, 2008, 06:09 PM
The first is syntactically valid but looks incorrect (or at best, misleading). The second is invalid.
The ternary conditional operator takes a boolean condition and two values. If the condition evaluates to true, the first value is returned; if not, the second.
The first snippet will evaluate $_X, then assign either false (if $_X is true) or true (if $_X is false) to $_Y, and return that.
Y.P.Y
Oct 23rd, 2008, 02:43 AM
Thanks Penagate. Resolved ;).
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.