[PHPwestoz] Order of execution

Timothy White weirdo at tigris.org
Mon Mar 14 18:55:02 UTC 2005


Nicolas Connault wrote:

> Timothy White wrote:
>
>> I'm building a simple php system and being the unix programmer I love to
>> have functions and not have much code in the body.
>> I want to do something like this
>> function x(){}
>> function y(){}
>> function z(){}
>> x() && y() && z()...
>> So that each function will execute in turn but only if the previous
>> function returns 1.
>> I can do (x() && y()) && z() and get it kinda working but I'm sure there
>> is an easier way.
>
>
> I'm sure that's not what you're looking for, but it's how I would do it:
>
> if(x() == 1){
>    if(y() == 1) z()
> }
>
> I think that's pretty minimal coding for the result you want.

Although I'm looking for something that can expand to many functions.
I guess I can use what if's although more efficiently than you've done it.
It's actually really simple now that I look at it although not easy to
read it's quick to program and make changes.
if(x())if(y())if(z())if(a())...i();

Tim

--
Tim White - Use the Fox, Luke!
PGP/GPG id: 602E944D, Pub Key Serv: subkeys.pgp.net
Fingerprint: 04C2 9682 B7B2 3006 009D  A9F3 067E EDCD 602E 944D
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!
--
Linux linmedia 2.6.10linmedia #4 Mon Feb 21 21:19:38 WST 2005 i686 GNU/Linux

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.linux.org.au/pipermail/phpwestoz/attachments/20050314/e33974a5/attachment.pgp 


More information about the PHPwestoz mailing list