Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #10515 > unrolled thread

AND and OR

Started byTwayne <nobody@spamcop.net>
First post2013-08-15 20:21 -0400
Last post2013-08-16 11:42 -0400
Articles 4 on this page of 24 — 8 participants

Back to article view | Back to comp.lang.php


Contents

  AND and OR Twayne <nobody@spamcop.net> - 2013-08-15 20:21 -0400
    Re: AND and OR Paul Herber <paul@pherber.com> - 2013-08-16 01:30 +0100
      Re: AND and OR Christoph Michael Becker <cmbecker69@arcor.de> - 2013-08-16 13:08 +0200
      Re: AND and OR Twayne <nobody@spamcop.net> - 2013-08-16 12:14 -0400
    Re: AND and OR "Peter H. Coffin" <hellsop@ninehells.com> - 2013-08-15 20:08 -0500
    Re: AND and OR Tim Streater <timstreater@greenbee.net> - 2013-08-16 08:52 +0100
      Re: AND and OR Twayne <nobody@spamcop.net> - 2013-08-16 11:19 -0400
    Re: AND and OR The Natural Philosopher <tnp@invalid.invalid> - 2013-08-16 11:25 +0100
      Re: AND and OR Norman Peelman <npeelman@cfl.rr.com> - 2013-08-16 06:48 -0400
        Re: AND and OR The Natural Philosopher <tnp@invalid.invalid> - 2013-08-16 12:24 +0100
          Re: AND and OR Twayne <nobody@spamcop.net> - 2013-08-16 12:10 -0400
            Re: AND and OR The Natural Philosopher <tnp@invalid.invalid> - 2013-08-16 17:35 +0100
              Re: AND and OR Tim Streater <timstreater@greenbee.net> - 2013-08-16 17:47 +0100
                Re: AND and OR The Natural Philosopher <tnp@invalid.invalid> - 2013-08-16 18:13 +0100
                  Re: AND and OR Richard Yates <richard@yatesguitar.com> - 2013-08-17 07:20 -0700
                    Re: AND and OR The Natural Philosopher <tnp@invalid.invalid> - 2013-08-17 15:36 +0100
                      Re: AND and OR Richard Yates <richard@yatesguitar.com> - 2013-08-17 10:47 -0700
                        Re: AND and OR Twayne <nobody@spamcop.net> - 2013-08-17 14:05 -0400
                        Re: AND and OR The Natural Philosopher <tnp@invalid.invalid> - 2013-08-17 19:40 +0100
                Re: AND and OR Twayne <nobody@spamcop.net> - 2013-08-17 13:27 -0400
              Re: AND and OR Twayne <nobody@spamcop.net> - 2013-08-17 13:22 -0400
            Re: AND and OR Richard Yates <richard@yatesguitar.com> - 2013-08-17 07:19 -0700
        Re: AND and OR Twayne <nobody@spamcop.net> - 2013-08-16 11:53 -0400
      Re: AND and OR Twayne <nobody@spamcop.net> - 2013-08-16 11:42 -0400

Page 2 of 2 — ← Prev page 1 [2]


#10553

FromTwayne <nobody@spamcop.net>
Date2013-08-17 13:22 -0400
Message-ID<kuobgi$hs6$1@speranza.aioe.org>
In reply to#10530
On 2013-08-16 12:35 PM, The Natural Philosopher wrote:
...

>
> well counting left and right brackets is fundamental programming, and
> someone who makes such a basic mistake *and doesn't see it*  is pretty
> new to the game. Whether the brackets matched or not in the presented
code wasn't checked closely, and likely should have been; it's but one 
of several tries
I made where the bracket matches checked fine in my Editor. However, the 
bracket problem was a bit more than just a missing bracket; I misplaced 
them and badly.

No arguement there.
>
> As I said, the ! operator is less intuitive than '==0' to me anyway,
> though after years of C its second nature.

Well, I unfortunetaly don't have a C history, but I do often the find 
the ! operator quite useful and often a way to have less code in that 
often no ELSE is needed that way. Which BTW is now my current interest; 
minimizing the amount of code used and still have it more or less 
self-documenting.

Cheers,

Twayne`

>
>

...


[toc] | [prev] | [next] | [standalone]


#10548

FromRichard Yates <richard@yatesguitar.com>
Date2013-08-17 07:19 -0700
Message-ID<ld1v09puj5bcvu1p251l1olcp2n03lidlb@4ax.com>
In reply to#10528
On Fri, 16 Aug 2013 12:10:43 -0400, Twayne <nobody@spamcop.net> wrote:

>On 2013-08-16 7:24 AM, The Natural Philosopher wrote:
>> On 16/08/13 11:48, Norman Peelman wrote:
>>> On 08/16/2013 06:25 AM, The Natural Philosopher wrote:
>>>> On 16/08/13 01:21, Twayne wrote:
>>>>>    Hi,
>>>>>
>>>>> Doing code cleanup; something that seemed so simple is giving me lots
>>>>> of trouble for whatever reason.
>>>>>
>
>...
>
>>>
>>> As well as:
>>>
>>> if (!strlen(var1) || !strlen(var2) || !strlen(var3))
>>>
>>>
>> Yebbut, for twayne, that may be taking things a step too far..
>
>Perhaps, but I don't think so. While many things in PHP are still 
>unknown to me, a lot is known to me. I've gained a LOT of knowledge over 
>the last few months and have put 99% of it to use.

From my limited perspective, your greatest gap is in techniques for
systematically identifying errors. The two most recent were: not being
checking if session variables were making it to the script, and
unbalanced parentheses. The methods for finding these types of errors
are not language-specific.

[toc] | [prev] | [next] | [standalone]


#10527

FromTwayne <nobody@spamcop.net>
Date2013-08-16 11:53 -0400
Message-ID<kulhtn$k6j$1@speranza.aioe.org>
In reply to#10522
On 2013-08-16 6:48 AM, Norman Peelman wrote:
> On 08/16/2013 06:25 AM, The Natural Philosopher wrote:
>> On 16/08/13 01:21, Twayne wrote:
>>>   Hi,
>>>
>>> Doing code cleanup; something that seemed so simple is giving me lots
>>> of trouble for whatever reason.
>>>

...

>
> As well as:
>
> if (!strlen(var1) || !strlen(var2) || !strlen(var3))
>
>

That looks familiar; as in, the sample I wasn't able to re-find; Thanks 
Much! The sample code was, I think, an isset() or a mail() setup, but 
same difference.

Regards,

Twayne`

[toc] | [prev] | [next] | [standalone]


#10526

FromTwayne <nobody@spamcop.net>
Date2013-08-16 11:42 -0400
Message-ID<kulh8l$iee$1@speranza.aioe.org>
In reply to#10520
On 2013-08-16 6:25 AM, The Natural Philosopher wrote:
> On 16/08/13 01:21, Twayne wrote:
>>   Hi,
>>
>> Doing code cleanup; something that seemed so simple is giving me lots
>> of trouble for whatever reason.
>>
>> Win 7,  XAMPP, PHP 5.3, online forms:
>>
>> In my cleanup efforts I've been trying to concatenate statements for
>> things like the following:
>>
>> IF(strlen(var1) == 0) OR strlen(var2) == 0) OR strlen(var3) ==0))
>> {

>>...

>>
>
> your brackets are screwed.
>
> if ((strlen(var1) == 0) || (strlen(var2) == 0) || (strlen(var3) ==0))
>
> will work
> as will
> if (strlen(var1) == 0 || strlen(var2) == 0 || strlen(var3) ==0)
>

Hmm, thanks. I'll look into those formats.

Thanks much,

Twayne`

...

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.php


csiph-web