For steps and sequences, I always use switches.  Most commonly associated with the 
"action" variable, it would look like this:

switch($action) {
   default:
      // what to show if no variable exists, or is set to a value
      // that is not acceptable below
   break;
   case "add_file":
      // what to do in the even that a file needs to be added
      // to the database.
   break;
   case "remove_file":
      // what to do in the even that a file need sto be removed
      // from the database.
   break;
}

Basically, whatever the value of $action, that is what section of code will execute.  
Hope that helps!

Martin Clifford
Homepage: http://www.completesource.net
Developer's Forums: http://www.completesource.net/forums/


>>> "Javier Montserat" <[EMAIL PROTECTED]> 07/23/02 10:03AM >>>
is there a more programmatically elegant way of saying...

$isError = "";

function main() {

    doStep1();

    if (!$isError) {
        doStep2();
    }

    if (!$isError) {
        doStep3();
    }
    // etc. etc.
}

function doStep1() {
    if ($something) {
        $isError = 1;
    }
}

function doStep2() {
    if ($something) {
        $isError = 1;
    }
}

_________________________________________________________________
Join the world's largest e-mail service with MSN Hotmail. 
http://www.hotmail.com 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to