x = "&&"

gives "Command contains unrecognized phrase/keyword."


x = "&" + "&"

works ok.

Re: a simple bug by Gene

Gene
Wed Dec 19 23:55:12 CST 2007

"Paul Pedersen" <nospam@no.spam> wrote:

>x = "&&"
>
>gives "Command contains unrecognized phrase/keyword."
>
>
>x = "&" + "&"
>
>works ok.

From the VFP on-line docs:
'Caution
Including double ampersands (&&) in a string literal, for example,
"AAA&&BBB", generates an error. Instead, to include double ampersands,
use concatenation as shown: "AAA&" + "&" + "BBB".'

I call it a glitch not a bug. (This really helps, eh?) It has a
cousin:
* I will just casually put a semi-colon at the end of this line;
select * from fatchance
* and watch the commotion.

Let us not forget
on error * Turn off error handling.
which is not the same as
on error

VFP: the language with the killer comments.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

Re: a simple bug by Man-wai

Man-wai
Thu Dec 20 04:01:05 CST 2007

> x = "&" + "&"

Out of curiosity, why do you need this string?

--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 7.04) Linux 2.6.23.12
^ ^ 18:00:01 up 1 day 2:43 1 user load average: 1.01 1.02 0.97
? ? (CSSA):
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa/

Re: a simple bug by Fred

Fred
Thu Dec 20 06:43:57 CST 2007

Cute. <s> I'd always heard it as it's a bug until it's documented. Then
it becomes a feature. More like a larvae to a butterfly. ;)

--
Fred
Microsoft Visual FoxPro MVP


"Paul Pedersen" <nospam@no.spam> wrote in message
news:erGZBFtQIHA.6036@TK2MSFTNGP03.phx.gbl...
>
>
>



Re: a simple bug by Paul

Paul
Thu Dec 20 08:45:42 CST 2007

I was passing a string to an external process (over which I have no
control), which was unexpectedly stripping out ampersands. I had hoped that
doubling it or putting a backslash in front of it would prevent that from
happening, but no such luck.


"Man-wai Chang ToDie" <toylet.toylet@gmail.com> wrote in message
news:e3f748uQIHA.536@TK2MSFTNGP06.phx.gbl...
>> x = "&" + "&"
>
> Out of curiosity, why do you need this string?
>
> --
> @~@ Might, Courage, Vision, SINCERITY.
> / v \ Simplicity is Beauty! May the Force and Farce be with you!
> /( _ )\ (Xubuntu 7.04) Linux 2.6.23.12
> ^ ^ 18:00:01 up 1 day 2:43 1 user load average: 1.01 1.02 0.97
> ? ? (CSSA):
> http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa/



Re: a simple bug by Rush

Rush
Thu Dec 20 10:14:58 CST 2007

Gene Wirchenko wrote:
> Let us not forget
> on error * Turn off error handling.
> which is not the same as
> on error
>
>
Perhaps of more interest is that:

ON ERROR * Turn off error handling

is not the same as:

ON ERROR && Turn off error handling

Using the asterisk syntax apparently causes Fox to treat the comment as
a compilable code fragment, and custom error handling (which will do
nothing) is enabled. Using the double ampersand causes the comment to
be stripped by the compiler, disabling custom error handling (same as:
ON ERROR).

From a coding perspective, consider:

ON ERROR DO SpecialErrorHandler WITH ;
ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )

If you're still debugging SpecialErrorHandler(), you can bypass it by
either:

ON ERROR * DO SpecialErrorHandler WITH ;
ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )

ON ERROR && DO SpecialErrorHandler WITH ;
ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )

The first case will ignore errors, the second defaults to the system
error handler. Note that either syntax 'works' properly with the
continuation line.

- Rush

Re: a simple bug by Gene

Gene
Thu Dec 20 12:05:22 CST 2007

"Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote:

>Cute. <s> I'd always heard it as it's a bug until it's documented. Then
>it becomes a feature. More like a larvae to a butterfly. ;)

Or moth.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

Re: a simple bug by Fred

Fred
Thu Dec 20 18:52:58 CST 2007

"Gene Wirchenko" <genew@ocis.net> wrote in message
news:7mblm3l1q4mvf104i11ak9u6lb255b6phk@4ax.com...
> "Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote:
>
>>Cute. <s> I'd always heard it as it's a bug until it's documented. Then
>>it becomes a feature. More like a larvae to a butterfly. ;)
>
> Or moth.
>

Or, depending on it's size, Mothra.

--
Fred
Microsoft Visual FoxPro MVP




Re: a simple bug by Man-wai

Man-wai
Thu Dec 20 20:37:12 CST 2007

Paul Pedersen wrote:
> I was passing a string to an external process (over which I have no
> control), which was unexpectedly stripping out ampersands. I had hoped that
> doubling it or putting a backslash in front of it would prevent that from
> happening, but no such luck.

What is that "external process"?

--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 7.04) Linux 2.6.23.12
^ ^ 10:36:01 up 1 day 19:19 1 user load average: 0.03 0.03 0.00
? ? (CSSA):
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa/

Re: a simple bug by tom

tom
Fri Dec 21 09:06:08 CST 2007

Hi,

an easy solution : do not comment your source :-)
Merry christmas and happy new year.

Tom

"Rush Strong" <rpstrong@gmail.com> schrieb im Newsbeitrag
news:6ywaj.6621$Vg1.56@trndny04...
> Gene Wirchenko wrote:
>> Let us not forget
>> on error * Turn off error handling.
>> which is not the same as
>> on error
>>
>>
> Perhaps of more interest is that:
>
> ON ERROR * Turn off error handling
>
> is not the same as:
>
> ON ERROR && Turn off error handling
>
> Using the asterisk syntax apparently causes Fox to treat the comment as a
> compilable code fragment, and custom error handling (which will do
> nothing) is enabled. Using the double ampersand causes the comment to be
> stripped by the compiler, disabling custom error handling (same as: ON
> ERROR).
>
> From a coding perspective, consider:
>
> ON ERROR DO SpecialErrorHandler WITH ;
> ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )
>
> If you're still debugging SpecialErrorHandler(), you can bypass it by
> either:
>
> ON ERROR * DO SpecialErrorHandler WITH ;
> ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )
>
> ON ERROR && DO SpecialErrorHandler WITH ;
> ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )
>
> The first case will ignore errors, the second defaults to the system error
> handler. Note that either syntax 'works' properly with the continuation
> line.
>
> - Rush



Re: a simple bug by Paul

Paul
Fri Dec 21 13:59:52 CST 2007


"tom knauf" <hbgmail@pdtgmbh.de> wrote in message
news:fkgkp2$uqm$00$1@news.t-online.com...

> an easy solution : do not comment your source :-)

Ha ha! I love it!




Re: a simple bug by Rush

Rush
Fri Dec 21 16:53:21 CST 2007

Usenet wrote:
>> Perhaps of more interest is that:
>>
>> ON ERROR * Turn off error handling
>>
>
> Why is this interesting? At this point in a line the asterisk is not
> comment delimiter.
>
> Regards
> Mark
>
>
But when the code runs, the asterisk is interpreted as being in column 1
and DOES serve as a comment delimiter.

- Rush

Re: a simple bug by glene77is

glene77is
Sat Dec 22 13:44:49 CST 2007

On Dec 21, 3:15=A0pm, Usenet <M...@dont.spamme.invalid> wrote:
> > Perhaps of more interest is that:
>
> > =A0 =A0 ON ERROR * Turn off error handling
>
> Why is this interesting? =A0At this point in a line the asterisk is not
> comment delimiter.
>
> Regards
> Mark

Mark,

Now, THAT is interesting. Re-Interpreting the asterisk to be
contained in the following code string !

Paul's idea of NOT having comments is funny. But that is not a good
work-around.

This is the closest I've ever come to Not having comments:
I wrote a 700K line program, once, and had a backup method.
The backup method read the files from the server to my workstation HD
that went through PKzip, with all comments.
Then the backup routine called a parser from my workstation, which
read the server code, stripped out all comments.
Then the backup routine backed-up the Stripped-out server version for
the server backup copy.

That kept the man who paid for the code from mucking with it, or
'tweaking' it as he called it.
Every morning I un-zipped and reloaded my workstation copy to the
server, then went back to work.

Glen Ellis, Memphis, TN
www.GeoCities.Com/glene77is

Re: a simple bug by Gene

Gene
Sat Dec 22 21:54:49 CST 2007

Usenet <Mark@dont.spamme.invalid> wrote:

>> Perhaps of more interest is that:
>>
>> ON ERROR * Turn off error handling
>
>Why is this interesting? At this point in a line the asterisk is not
>comment delimiter.

You are mistaken. While the on-line docs for * (and note) state
that they are non-executing statements, that is not true. The example
above means, when an error occurs, execute the comment. This means do
nothing. It is the xBASE equivalent of on error resume next.

This is not the same as
on error
which means that when an error occurs, do the system action for errors
(emit error and ask Cancel, Ignore, Suspend).

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

Re: a simple bug by Rush

Rush
Sat Dec 22 22:03:08 CST 2007

This is a multi-part message in MIME format.
--------------010907000603070100040407
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Gene Wirchenko wrote:
> Usenet <Mark@dont.spamme.invalid> wrote:
>
>
>>> Perhaps of more interest is that:
>>>
>>> ON ERROR * Turn off error handling
>>>
>> Why is this interesting? At this point in a line the asterisk is not
>> comment delimiter.
>>
>
> You are mistaken. While the on-line docs for * (and note) state
> that they are non-executing statements, that is not true. The example
> above means, when an error occurs, execute the comment. This means do
> nothing. It is the xBASE equivalent of on error resume next.
>
> This is not the same as
> on error
> which means that when an error occurs, do the system action for errors
> (emit error and ask Cancel, Ignore, Suspend).
>
> Sincerely,
>
> Gene Wirchenko
>
> Computerese Irregular Verb Conjugation:
> I have preferences.
> You have biases.
> He/She has prejudices.
>
This is similar to the technique of using a comment only line of code in
a method in order to prevent parent method code from executing. The
comment itself does nothing, but it has a different effect than having
nothing there at all.

- Rush

--------------010907000603070100040407
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Gene Wirchenko wrote:
<blockquote cite="mid:4pmrm3dr3cg36gmk8umibj577h2kq72gke@4ax.com"
type="cite">
<pre wrap="">Usenet <a class="moz-txt-link-rfc2396E" href="mailto:Mark@dont.spamme.invalid">&lt;Mark@dont.spamme.invalid&gt;</a> wrote:

</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">Perhaps of more interest is that:

ON ERROR * Turn off error handling
</pre>
</blockquote>
<pre wrap="">Why is this interesting? At this point in a line the asterisk is not
comment delimiter.
</pre>
</blockquote>
<pre wrap=""><!---->
You are mistaken. While the on-line docs for * (and note) state
that they are non-executing statements, that is not true. The example
above means, when an error occurs, execute the comment. This means do
nothing. It is the xBASE equivalent of on error resume next.

This is not the same as
on error
which means that when an error occurs, do the system action for errors
(emit error and ask Cancel, Ignore, Suspend).

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
</pre>
</blockquote>
This is similar to the technique of using a comment only line of code
in a method in order to prevent parent method code from executing.&nbsp; The
comment itself does nothing, but it has a different effect than having
nothing there at all.<br>
<br>
&nbsp;- Rush<br>
</body>
</html>

--------------010907000603070100040407--

Re: a simple bug by Gene

Gene
Sun Dec 23 00:46:06 CST 2007

Rush Strong <rpstrong@gmail.com> wrote:

[snip]

>This is similar to the technique of using a comment only line of code in
>a method in order to prevent parent method code from executing. The
>comment itself does nothing, but it has a different effect than having
>nothing there at all.

It needs a colourful name. How about "dog-in-the-manger
comment"?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

Re: a simple bug by Dan

Dan
Mon Dec 24 10:23:19 CST 2007

Gene Wirchenko wrote:
> Usenet <Mark@dont.spamme.invalid> wrote:
>
>>> Perhaps of more interest is that:
>>>
>>> ON ERROR * Turn off error handling
>>
>> Why is this interesting? At this point in a line the asterisk is not
>> comment delimiter.
>
> You are mistaken. While the on-line docs for * (and note) state
> that they are non-executing statements, that is not true. The example
> above means, when an error occurs, execute the comment. This means do
> nothing. It is the xBASE equivalent of on error resume next.

Marcia Aikens tells a story about being called in to do some work on an
existing application.

She sat there staring at some code thinking "this can't POSSIBLY work!", but
the application was in production.

Later, they discovered ON ERROR * at the top of the application. When they
took that out, it blew up left and right! <g>

Dan



Re: a simple bug by Gene

Gene
Fri Dec 28 13:16:11 CST 2007

"Dan Freeman" <spam@microsoft.com> wrote:

[snip]

>Later, they discovered ON ERROR * at the top of the application. When they
>took that out, it blew up left and right! <g>

I recall reading a story about a problem with some Apple
software. The person trying to deal with the bug realised that there
was no way the particular code could be working. Finally, he got the
source. It compiled with no errors. Then, he looked more closely.
The programmer had shut off the compiler reporting of errors. The
code did not compile correctly.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.