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 20 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 1 of 2  [1] 2  Next page →


#10515 — AND and OR

FromTwayne <nobody@spamcop.net>
Date2013-08-15 20:21 -0400
SubjectAND and OR
Message-ID<kujr9n$il7$1@speranza.aioe.org>
  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))
{
code; notify user of errors that must be corrected.
}

I know OR is || and AND is &&, and have tried every combination of code 
I can think of but I consistently get syntax errors and it never works.
    Doing each var independently works fine; e.g. if(strlen($var) == 0) 
{...}, works as expected, first time every time.

It's when I start to try to use AND or OR that I get in trouble; I 
continually get syntax errors, suggesting I don't know what I'm doing, 
which I guess is obvious.
     At one time I had a downloaded code page explaining precisely how 
to OR them together, but darned if I can refind it on my hard drive OR 
online either! I just cannot locate the proper way to OR vars together.

Either a code example or URL to such a feature would be great! I am just 
not finding anything on Google or otherwise to demo how it works!

Thanks in Advance,

Twayne`

[toc] | [next] | [standalone]


#10516

FromPaul Herber <paul@pherber.com>
Date2013-08-16 01:30 +0100
Message-ID<qisq095ngsubpq993rcsms7ur3phdlqbnl@news.eternal-september.org>
In reply to#10515
On Thu, 15 Aug 2013 20:21:09 -0400, Twayne <nobody@spamcop.net> 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))
>{
>code; notify user of errors that must be corrected.
>}

RTM, the syntax is clear.

http://php.net/manual/en/control-structures.if.php



-- 
Regards, Paul Herber, Sandrila Ltd.
http://www.sandrila.co.uk/    twitter: @sandrilaLtd      

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


#10523

FromChristoph Michael Becker <cmbecker69@arcor.de>
Date2013-08-16 13:08 +0200
Message-ID<520e07e2$0$6628$9b4e6d93@newsspool2.arcor-online.net>
In reply to#10516
Am 16.08.2013 02:30, schrieb Paul Herber:
> On Thu, 15 Aug 2013 20:21:09 -0400, Twayne <nobody@spamcop.net> 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))
>> {
>> code; notify user of errors that must be corrected.
>> }
> 
> RTM, the syntax is clear.
> 
> http://php.net/manual/en/control-structures.if.php

ACK.

Regarding the syntax of variables the following seems to also be
recommendable:

<http://www.php.net/manual/en/language.variables.basics.php>

-- 
Christoph M. Becker

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


#10529

FromTwayne <nobody@spamcop.net>
Date2013-08-16 12:14 -0400
Message-ID<kulj5m$nn5$1@speranza.aioe.org>
In reply to#10516
On 2013-08-15 8:30 PM, Paul Herber wrote:
> On Thu, 15 Aug 2013 20:21:09 -0400, Twayne <nobody@spamcop.net> 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))
>> {
>> code; notify user of errors that must be corrected.
>> }
>
> RTM, the syntax is clear.
>
> http://php.net/manual/en/control-structures.if.php
>
>
>

No, it's not clear at all. The only reference to my query is a few lines 
in a 2-year old post and it's not definitve. I've not only read that 
before, but have it on disc.

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


#10517

From"Peter H. Coffin" <hellsop@ninehells.com>
Date2013-08-15 20:08 -0500
Message-ID<slrnl0qut3.mfn.hellsop@nibelheim.ninehells.com>
In reply to#10515
On Thu, 15 Aug 2013 20:21:09 -0400, 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))
    1      2    1     0          1    0     *          1    0    **
> {
> code; notify user of errors that must be corrected.
> }
>


-- 
40. I will be neither chivalrous nor sporting. If I have an unstoppable 
    superweapon, I will use it as early and as often as possible instead
    of keeping it in reserve.
	--Peter Anspach's list of things to do as an Evil Overlord

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


#10519

FromTim Streater <timstreater@greenbee.net>
Date2013-08-16 08:52 +0100
Message-ID<timstreater-C0895E.08522616082013@news.individual.net>
In reply to#10515
In article <kujr9n$il7$1@speranza.aioe.org>,
 Twayne <nobody@spamcop.net> 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))
> {
> code; notify user of errors that must be corrected.
> }

Come on you hairy fathead this is trivial stuff. Your parens are not 
balanced.

-- 
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

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


#10525

FromTwayne <nobody@spamcop.net>
Date2013-08-16 11:19 -0400
Message-ID<kulfug$epr$1@speranza.aioe.org>
In reply to#10519
On 2013-08-16 3:52 AM, Tim Streater wrote:
> In article <kujr9n$il7$1@speranza.aioe.org>,
> Twayne <nobody@spamcop.net> 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))
>> {
>> code; notify user of errors that must be corrected.
>> }
>
> Come on you hairy fathead this is trivial stuff. Your parens are not
> balanced.
>

Hmm. you can be pretty much a trolling idiot at times, huh? A "normal" 
person would just not bother to read, let alone waste time responding in 
such manner.  I'll not be reading your useless posts any longer so flop 
around on the dock all you want. Oh, and enjoy!

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


#10520

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2013-08-16 11:25 +0100
Message-ID<kukun7$l54$4@news.albasani.net>
In reply to#10515
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))
> {
> code; notify user of errors that must be corrected.
> }
>
> I know OR is || and AND is &&, and have tried every combination of
> code I can think of but I consistently get syntax errors and it never
> works.
>    Doing each var independently works fine; e.g. if(strlen($var) == 0)
> {...}, works as expected, first time every time.
>

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)

> It's when I start to try to use AND or OR that I get in trouble; I
> continually get syntax errors, suggesting I don't know what I'm doing,
> which I guess is obvious.
>     At one time I had a downloaded code page explaining precisely how
> to OR them together, but darned if I can refind it on my hard drive OR
> online either! I just cannot locate the proper way to OR vars together.
>
> Either a code example or URL to such a feature would be great! I am
> just not finding anything on Google or otherwise to demo how it works!
>
> Thanks in Advance,
>
> Twayne`


-- 
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.

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


#10522

FromNorman Peelman <npeelman@cfl.rr.com>
Date2013-08-16 06:48 -0400
Message-ID<kul02j$qos$1@dont-email.me>
In reply to#10520
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.
>>
>> 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))
>> {
>> code; notify user of errors that must be corrected.
>> }
>>
>> I know OR is || and AND is &&, and have tried every combination of
>> code I can think of but I consistently get syntax errors and it never
>> works.
>>     Doing each var independently works fine; e.g. if(strlen($var) == 0)
>> {...}, works as expected, first time every time.
>>
>
> 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)
>

As well as:

if (!strlen(var1) || !strlen(var2) || !strlen(var3))


-- 
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-

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


#10524

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2013-08-16 12:24 +0100
Message-ID<kul25k$tl9$1@news.albasani.net>
In reply to#10522
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.
>>>
>>> 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))
>>> {
>>> code; notify user of errors that must be corrected.
>>> }
>>>
>>> I know OR is || and AND is &&, and have tried every combination of
>>> code I can think of but I consistently get syntax errors and it never
>>> works.
>>>     Doing each var independently works fine; e.g. if(strlen($var) == 0)
>>> {...}, works as expected, first time every time.
>>>
>>
>> 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)
>>
>
> As well as:
>
> if (!strlen(var1) || !strlen(var2) || !strlen(var3))
>
>
Yebbut, for twayne, that may be taking things a step too far..

many many years ago when I was a real noob and learning C without the
benefit of any training courses,  I had to revisit some code to find two
bugs in it. The new person who had taken over asked me why I had never
used a particular language construct.  I replied 'because at the time, I
didn't know it existed'

Trainee coders are often dumped into maintenance.  One should be kind to
them. And with advances in modern compilers, there is no speed or
compiled code size penalty in being explicit at the source code level.

We were all noobs once.

-- 
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.

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


#10528

FromTwayne <nobody@spamcop.net>
Date2013-08-16 12:10 -0400
Message-ID<kuliu3$n2b$1@speranza.aioe.org>
In reply to#10524
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. My goal hasn't been 
to learn all there is about PHP and likely never will be since IMO 
learning how/where to find answers, understand the syntax properly, 
error checking, sessions, arrays and the like have been my recent goals. 
I write online PHP forms for websites and that's where my attentions are 
focused until I know them well. The "manual" at php.net and w3 schools 
IMO are the best "bibles" plus a few other places like NAS and Tizag are 
pretty good too, among others.

>
> many many years ago when I was a real noob and learning C without the
> benefit of any training courses,  I had to revisit some code to find two
> bugs in it. The new person who had taken over asked me why I had never
> used a particular language construct.  I replied 'because at the time, I
> didn't know it existed'
>
> Trainee coders are often dumped into maintenance.  One should be kind to
> them. And with advances in modern compilers, there is no speed or
> compiled code size penalty in being explicit at the source code level.
>
> We were all noobs once.
>

While I appreciate your attitude toward noobies, I've found over the 
years that words such as this are never understood by over-sized ego's 
or OTOH might draw some flames. I've come across several of that type on 
other newsgroups and forums I participate on. Mostly it's best just to 
ignore their posts. Personally I'll usually respond in kind to such a 
thing one time and then simply ignore them.

I do thank you for your attitude, however,

Twayne`

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


#10530

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2013-08-16 17:35 +0100
Message-ID<kulkcc$39s$1@news.albasani.net>
In reply to#10528
On 16/08/13 17:10, Twayne 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. My goal hasn't
> been to learn all there is about PHP and likely never will be since
> IMO learning how/where to find answers, understand the syntax
> properly, error checking, sessions, arrays and the like have been my
> recent goals. I write online PHP forms for websites and that's where
> my attentions are focused until I know them well. The "manual" at
> php.net and w3 schools IMO are the best "bibles" plus a few other
> places like NAS and Tizag are pretty good too, among others.
>

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.

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


>>
>> many many years ago when I was a real noob and learning C without the
>> benefit of any training courses,  I had to revisit some code to find two
>> bugs in it. The new person who had taken over asked me why I had never
>> used a particular language construct.  I replied 'because at the time, I
>> didn't know it existed'
>>
>> Trainee coders are often dumped into maintenance.  One should be kind to
>> them. And with advances in modern compilers, there is no speed or
>> compiled code size penalty in being explicit at the source code level.
>>
>> We were all noobs once.
>>
>
> While I appreciate your attitude toward noobies, I've found over the
> years that words such as this are never understood by over-sized ego's
> or OTOH might draw some flames. I've come across several of that type
> on other newsgroups and forums I participate on. Mostly it's best just
> to ignore their posts. Personally I'll usually respond in kind to such
> a thing one time and then simply ignore them.
>
by definition at this particular  game you ARE a noob. or you wouldn't
have missed the unmatched brackets. I  ceratyinly d0nt see that as any
reflection on unerlying intelligence...teh first program I wrte in
assembler I copied exactly out of a book. It didnt assemble. Then I took
the line numbers out. It still didn't assemble. Then I removed all
leading spaces from every line. That did work. That took two 4 hour
sessions of frustration.

I wasn't stupid. I simply had no idea, nor did the documentation say,
that line numbers and spaces were tabu.



> I do thank you for your attitude, however,
>
> Twayne`


-- 
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.

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


#10531

FromTim Streater <timstreater@greenbee.net>
Date2013-08-16 17:47 +0100
Message-ID<timstreater-1DBC0D.17470316082013@news.individual.net>
In reply to#10530
In article <kulkcc$39s$1@news.albasani.net>,
 The Natural Philosopher <tnp@invalid.invalid> wrote:

> by definition at this particular  game you ARE a noob. or you wouldn't
> have missed the unmatched brackets.

Not necessarily. Anyone can miss them if they are tired etc. But we then 
find them after a while. I'd say no one should be coming here with 
missed brackets unless they've spent some time looking and can't find it.

There again, I use TextWrangler. This allows me to double click just 
inside any bracket or paren, and it highlights everything up to the 
matching closing bracket or paren. That will tell you straight away that 
you've got a missing one, or, by descending into it, whether you got 
them *correctly* matched.

-- 
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

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


#10532

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2013-08-16 18:13 +0100
Message-ID<kulmit$788$2@news.albasani.net>
In reply to#10531
On 16/08/13 17:47, Tim Streater wrote:
> In article <kulkcc$39s$1@news.albasani.net>,
> The Natural Philosopher <tnp@invalid.invalid> wrote:
>
>> by definition at this particular  game you ARE a noob. or you wouldn't
>> have missed the unmatched brackets.
>
> Not necessarily. Anyone can miss them if they are tired etc. But we
> then find them after a while. I'd say no one should be coming here
> with missed brackets unless they've spent some time looking and can't
> find it.
>
> There again, I use TextWrangler. This allows me to double click just
> inside any bracket or paren, and it highlights everything up to the
> matching closing bracket or paren. That will tell you straight away
> that you've got a missing one, or, by descending into it, whether you
> got them *correctly* matched.
>
well I use geany, and unmatched anything tends to go red..

I wasnt objecting to the error, but bringing it here. I'd say I
generally have an unmatched bracket for every 20 or so brackets I type :-)


-- 
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.

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


#10549

FromRichard Yates <richard@yatesguitar.com>
Date2013-08-17 07:20 -0700
Message-ID<4l1v09tmma2cbbm4qtdu1rn77rcrkhvqqq@4ax.com>
In reply to#10532
On Fri, 16 Aug 2013 18:13:01 +0100, The Natural Philosopher
<tnp@invalid.invalid> wrote:

>I wasnt objecting to the error, but bringing it here. I'd say I
>generally have an unmatched bracket for every 20 or so brackets I type :-)

For me it's every 19...

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


#10550

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2013-08-17 15:36 +0100
Message-ID<kuo1p7$k7d$1@news.albasani.net>
In reply to#10549
On 17/08/13 15:20, Richard Yates wrote:
> On Fri, 16 Aug 2013 18:13:01 +0100, The Natural Philosopher
> <tnp@invalid.invalid> wrote:
>
>> I wasnt objecting to the error, but bringing it here. I'd say I
>> generally have an unmatched bracket for every 20 or so brackets I type :-)
> For me it's every 19...
and about every third function call the throws 'unknownfunction' due to
mistyping the name..
..i now have a browser window that by some secret magic allows me to
view the error log files on a distant machine..purely to seed up
typograhical debugging.


-- 
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.

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


#10558

FromRichard Yates <richard@yatesguitar.com>
Date2013-08-17 10:47 -0700
Message-ID<5jdv095cmv6l4tqd68jjs1hadq1o3tgjmc@4ax.com>
In reply to#10550
On Sat, 17 Aug 2013 15:36:22 +0100, The Natural Philosopher
<tnp@invalid.invalid> wrote:

>On 17/08/13 15:20, Richard Yates wrote:
>> On Fri, 16 Aug 2013 18:13:01 +0100, The Natural Philosopher
>> <tnp@invalid.invalid> wrote:
>>
>>> I wasnt objecting to the error, but bringing it here. I'd say I
>>> generally have an unmatched bracket for every 20 or so brackets I type :-)
>> For me it's every 19...

>and about every third function call the throws 'unknownfunction' due to
>mistyping the name..

I'm down to an error rate of 30% on = instead of == in if clauses.

>...purely to seed up typograhical debugging.

I guess it doesn't work on Usenet.

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


#10561

FromTwayne <nobody@spamcop.net>
Date2013-08-17 14:05 -0400
Message-ID<kuoe0b$oi9$1@speranza.aioe.org>
In reply to#10558
On 2013-08-17 1:47 PM, Richard Yates wrote:
> On Sat, 17 Aug 2013 15:36:22 +0100, The Natural Philosopher
> <tnp@invalid.invalid> wrote:
>
...
>
> I'm down to an error rate of 30% on = instead of == in if clauses.
>
>> ...purely to seed up typograhical debugging.
>
> I guess it doesn't work on Usenet.
>

Maybe I can offer a possible help for  some of that. If you editor 
allows you to, create clips or libraries so when you click them, they'll 
enter for you:
    ?PHP>

    ?>

or

HTML comment:
<!--   -->

PHP Comment Start:
if() === "" ) {

}

and it's especially useful for anything of more than a few characters, 
like $referrer, session functions, etc etc etc.

and so forth. By entering everything but the var & what goes between the 
"", you at least know all the surrounding code is current.

Also things like: <!DOCTYPE html> , <form action =, name=, et al 
including the end form & end HTML. It has a lot of uses once you create 
your own library or clip code.

There are of course complete libraries availble for PHP and HTML, C, and 
more, but in general I seldom use them unless I need to look up 
something I haven't done before. One does of course need to have the 
disclipine to update the clip/library as early as possible and to 
delete/replace the ones that are needed.
    It speeds up coding like nobody's business once it's set with your 
own often used or lengthy pieces of code.

Cheers,

Twayne`

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


#10563

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2013-08-17 19:40 +0100
Message-ID<kuog2u$hjg$2@news.albasani.net>
In reply to#10558
On 17/08/13 18:47, Richard Yates wrote:
> On Sat, 17 Aug 2013 15:36:22 +0100, The Natural Philosopher
> <tnp@invalid.invalid> wrote:
>
>> On 17/08/13 15:20, Richard Yates wrote:
>>> On Fri, 16 Aug 2013 18:13:01 +0100, The Natural Philosopher
>>> <tnp@invalid.invalid> wrote:
>>>
>>>> I wasnt objecting to the error, but bringing it here. I'd say I
>>>> generally have an unmatched bracket for every 20 or so brackets I type :-)
>>> For me it's every 19...
>> and about every third function call the throws 'unknownfunction' due to
>> mistyping the name..
> I'm down to an error rate of 30% on = instead of == in if clauses.
>
>> ...purely to seed up typograhical debugging.
> I guess it doesn't work on Usenet.
>
:-)

no, sadly not :-(


-- 
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.

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


#10554

FromTwayne <nobody@spamcop.net>
Date2013-08-17 13:27 -0400
Message-ID<kuobr2$irc$1@speranza.aioe.org>
In reply to#10531
On 2013-08-16 12:47 PM, Tim Streater wrote:
> In article <kulkcc$39s$1@news.albasani.net>,
> The Natural Philosopher <tnp@invalid.invalid> wrote:
>
...
>
> There again, I use TextWrangler. This allows me to double click just
> inside any bracket or paren, and it highlights everything up to the
> matching closing bracket or paren. That will tell you straight away that
> you've got a missing one, or, by descending into it, whether you got
> them *correctly* matched.
>

Many text editors, including my own, work much the same way. NoteTab Pro 
and NotePad++ to mention two of them I use most. They're all also 
capable of knowing when a file has been changed and offers to reload the 
most recent versions etc.

Twayne`

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


Page 1 of 2  [1] 2  Next page →

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


csiph-web