At 11:48 AM +0100 9/27/10, Ford, Mike wrote:
> -Original Message-
From: tedd [mailto:tedd.sperl...@gmail.com]
Sent: 25 September 2010 16:02
One can make the argument that the ELSE IF statement first surfaced
circa 1977 in FORTRAN 77 and the CASE statement came later in
FORTRAN
> -Original Message-
> From: tedd [mailto:tedd.sperl...@gmail.com]
> Sent: 25 September 2010 16:02
> One can make the argument that the ELSE IF statement first surfaced
> circa 1977 in FORTRAN 77 and the CASE statement came later in
> FORTRAN
> 90 circa 1991.
Being a fully-fledged membe
At 9:04 PM +0100 9/24/10, Ashley Sheridan wrote:
I don't often use this type of logic, but I have used it before and
it's served me well. Essentially, a switch is a glorified if
statement, and I find them a lot nicer to read and write than a
series of if/elseif blocks.
Thanks,
Ash
Ash:
Exa
At 3:54 PM -0400 9/24/10, Bob McConnell wrote:
From: tedd
At 2:23 PM -0400 9/24/10, Bob McConnell wrote:
>>A switch works when a single test can dispatch all possible branches.
If
you have a series of tests where each looks for a different subset of
>>conditions, you need an elseif.
On Fri, 2010-09-24 at 16:08 -0400, Joshua Kehn wrote:
> On Sep 24, 2010, at 4:04 PM, Ashley Sheridan wrote:
>
> > On Fri, 2010-09-24 at 15:54 -0400, Bob McConnell wrote:
> >
> >> From: tedd
> >>
> >>> At 2:23 PM -0400 9/24/10, Bob McConnell wrote:
>
> A switch works when a single tes
On Fri, 2010-09-24 at 15:54 -0400, Bob McConnell wrote:
> From: tedd
>
> > At 2:23 PM -0400 9/24/10, Bob McConnell wrote:
> >>
> >>A switch works when a single test can dispatch all possible branches.
> If
> >>you have a series of tests where each looks for a different subset of
> >>conditions,
On Fri, 2010-09-24 at 15:44 -0400, Steve Staples wrote:
> this would be the same as:
> (commented below)
>
> On Fri, 2010-09-24 at 15:30 -0400, tedd wrote:
> > At 2:23 PM -0400 9/24/10, Bob McConnell wrote:
> > >
> > >A switch works when a single test can dispatch all possible branches. If
> > >y
From: tedd
> At 2:23 PM -0400 9/24/10, Bob McConnell wrote:
>>
>>A switch works when a single test can dispatch all possible branches.
If
>>you have a series of tests where each looks for a different subset of
>>conditions, you need an elseif.
> Not so, O'wise one.
>
> This will work:
>
> swit
this would be the same as:
(commented below)
On Fri, 2010-09-24 at 15:30 -0400, tedd wrote:
> At 2:23 PM -0400 9/24/10, Bob McConnell wrote:
> >
> >A switch works when a single test can dispatch all possible branches. If
> >you have a series of tests where each looks for a different subset of
> >c
At 2:23 PM -0400 9/24/10, Bob McConnell wrote:
A switch works when a single test can dispatch all possible branches. If
you have a series of tests where each looks for a different subset of
conditions, you need an elseif.
Bob McConnell
Bob:
Not so, O'wise one.
This will work:
switch(1)
[snip]
I am not in the majority when I say for conditions where you have
more than two options use a switch control and not an elseif.
In 40+ years of programming, I have never used elseif because the
control confuses me. It is *much* easier for me to use, understand,
and document a switch stat
I found the problem while I was copying the code over. The problem is
that the if triggers in loop one, and the elseif triggers in loop two.
In other words, it does exactly what it's supposed to, I just didn't
think through what the loop would accomplish. Now to figure out how
to make it do what
From: tedd
> At 1:50 PM -0400 9/24/10, Andy McKenzie wrote:
>>Hey folks,
>>
>> Here's the deal. I have the following code:
>>
>>if($col_vals[$i][$val['column']] == $search_result[0][$col])
>> { echo ' selected="selected"'; }
>>elseif($val['default'] == $col_vals[$i][$val['column']])
>
At 1:50 PM -0400 9/24/10, Andy McKenzie wrote:
Hey folks,
Here's the deal. I have the following code:
if($col_vals[$i][$val['column']] == $search_result[0][$col])
{ echo ' selected="selected"'; }
elseif($val['default'] == $col_vals[$i][$val['column']])
{ echo ' selected="
if(1 == 1){
echo 'here';
}
elseif(1 == 1){
echo 'here"';
}
Will only echo "here" once.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Andy I see no reason why both echo's would fire; unless this block of code
gets executed multiple times. can we see more of the code?
Chris H.
On Fri, Sep 24, 2010 at 1:50 PM, Andy McKenzie wrote:
> Hey folks,
>
> Here's the deal. I have the following code:
>
> if($col_vals[$i][$val['column
Hey folks,
Here's the deal. I have the following code:
if($col_vals[$i][$val['column']] == $search_result[0][$col])
{ echo ' selected="selected"'; }
elseif($val['default'] == $col_vals[$i][$val['column']])
{ echo ' selected="selected"'; }
It's supposed to check whether t
17 matches
Mail list logo