[thelist] Switch statement

Chris axe at suburbia.com.au
Fri Jul 19 17:53:04 CDT 2002

Quoted from the PHP Manual itself:

"The switch statement executes line by line (actually, statement by
statement). In the beginning, no code is executed. Only when a case
statement is found with a value that matches the value of the switch
expression does PHP begin to execute the statements. PHP continues to
execute the statements until the end of the switch block, or the first time
it sees a break statement. If you don't write a break statement at the end
of a case's statement list, PHP will go on executing the statements of the
following case."

And also, I am pretty sure you can do conditional stuff, but I would have to
check that to be certain.


-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Mark Howells
Sent: Saturday, 20 July 2002 02:01
To: thelist at lists.evolt.org
Subject: Re: [thelist] Switch statement

> switch (hiscore) {
> case 100:
> addAGoldStarTo(jenny);
> }

> how do you do conditionals? iirc, you can't do 'case <= 40:' or can you?
> i don't think so.


should work, depending on which language you're using.

Mark Howells

For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !

More information about the thelist mailing list