Index
2014-04-12 13:43Allen : Bad getwordnum
2014-04-12 14:04Mike Copeland : Re: Bad getwordnum
2014-04-12 14:13Allen : RE: Bad getwordnum
2014-04-12 14:54Mike Copeland : Re: Bad getwordnum
2014-04-12 16:55Darren : Re: Bad getwordnum
2014-04-13 00:24AndyHC : Re: Bad getwordnum
2014-04-13 01:28Gérard Lochon : Re: Bad getwordnum
2014-04-13 02:50Allen : RE: Bad getwordnum
2014-04-14 06:56Naushad Ali Ali : Re: Bad getwordnum
2014-04-14 07:05Richard Kaye : RE: Bad getwordnum
Back to top
Bad getwordnum

Author: Allen

Posted: 2014-04-12 13:43:30   Link

Hi foxgang

I just spotted a nasty. GetWordNum. If you have say aa ="A,B,C,,,F" and ask

for GetWordNum(aa,4,",") it gets it wrong. Seems it cannot handle blanks. A

pain as I just had some.

Al

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/001c01cf567f$1a22b030$4e681090$@com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Allen
Back to top
Re: Bad getwordnum

Author: Mike Copeland

Posted: 2014-04-12 14:04:00   Link

Allen wrote:

> Hi foxgang

> I just spotted a nasty. GetWordNum. If you have say aa ="A,B,C,,,F" and ask

> for GetWordNum(aa,4,",") it gets it wrong. Seems it cannot handle blanks. A

> pain as I just had some.

> Al

Personal opinion ahead...

Not sure I'd call that a bug...technically you are asking it to deal

with null, not blanks. If you put a space between the commas instead of

nothing, it works as you expect. Check out GetWordCount()...which acts

the same way...it 'ignores' the non-existant "thing" between the 3rd and

4th commas, and the 4th and 5th commas.

I suspect this was more of an intentional, but undocumented (at least in

the Fox Help) "feature" that had to be handled one way or the other.

(either ignore "nothing" or count it.)

But, it would have been nice had they offered a switch to include, or

not, and had documented this behavior.

So, while I wouldn't call it a bug in VFP, I would call it an

undocumented feature...which often masquerades as a "BUG!"

Mike Copeland

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/53498E20.3080502@ggisoft.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Mike Copeland
Back to top
RE: Bad getwordnum

Author: Allen

Posted: 2014-04-12 14:13:30   Link

Hi Mike

I have to disagree (my opinion). It may be intentional but it's a pain and I

would call it either a bug or bad programming. For example CSV may not

always have anything between the commas. And you may not always have control

of what is sent. In this instance I got over it but I wonder how many other

places I have used GetWordNum and not even known it had failed. Before it

appeared in VFP I wrote my own, I wish I stuck with that now. At least that

worked.

Al

-----Original Message-----

Personal opinion ahead...

Not sure I'd call that a bug...technically you are asking it to deal with

null, not blanks. If you put a space between the commas instead of nothing,

it works as you expect. Check out GetWordCount()...which acts the same

way...it 'ignores' the non-existant "thing" between the 3rd and 4th commas,

and the 4th and 5th commas.

I suspect this was more of an intentional, but undocumented (at least in the

Fox Help) "feature" that had to be handled one way or the other.

(either ignore "nothing" or count it.)

But, it would have been nice had they offered a switch to include, or not,

and had documented this behavior.

So, while I wouldn't call it a bug in VFP, I would call it an undocumented

feature...which often masquerades as a "BUG!"

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/001d01cf5683$4ad19f30$e074dd90$@com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Allen
Back to top
Re: Bad getwordnum

Author: Mike Copeland

Posted: 2014-04-12 14:54:19   Link

Allen wrote:

> Hi Mike

> I have to disagree (my opinion). It may be intentional but it's a pain and I

> would call it either a bug or bad programming. For example CSV may not

> always have anything between the commas. And you may not always have control

> of what is sent. In this instance I got over it but I wonder how many other

> places I have used GetWordNum and not even known it had failed. Before it

> appeared in VFP I wrote my own, I wish I stuck with that now. At least that

> worked.

> Al

Yep, I agree it's a pain. "Undocumented functionality" is always

enjoyable (if you're a masochist.)

Just add it to the list of "uhoh..." to avoid.

And, yes, this is just my opinion. I'm sure someone finds this behavior

to be "perfectly acceptable and expected."

Mike

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/534999EB.10704@ggisoft.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Mike Copeland
Back to top
Re: Bad getwordnum

Author: Darren

Posted: 2014-04-12 16:55:59   Link

+1 here. Getwordnumber is floored IMHO. 

Best regards

Darren

-------- Original message --------

From: Mike Copeland <mike@ggisoft.com>

Date:12/04/2014 15:54 (GMT-05:00)

To: profoxtech@leafe.com

Subject: Re: Bad getwordnum

Allen wrote:

> Hi Mike

> I have to disagree (my opinion). It may be intentional but it's a pain and I

> would call it either a bug or bad programming. For example CSV may not

> always have anything between the commas. And you may not always have control

> of what is sent. In this instance I got over it but I wonder how many other

> places I have used GetWordNum and not even known it had failed. Before it

> appeared in VFP I wrote my own, I wish I stuck with that now. At least that

> worked.

> Al

Yep, I agree it's a pain. "Undocumented functionality" is always

enjoyable (if you're a masochist.)

Just add it to the list of "uhoh..." to avoid.

And, yes, this is just my opinion. I'm sure someone finds this behavior

to be "perfectly acceptable and expected."

Mike

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/534999EB.10704@ggisoft.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

Report [OT] Abuse: http://leafe.com/reportAbuse/534999EB.10704@ggisoft.com

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/vrp8fu3h0bey4g5j12f6fdue.1397339759305@email.android.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Darren
Back to top
Re: Bad getwordnum

Author: AndyHC

Posted: 2014-04-13 00:24:20   Link

Like I keep telling people - some day nulls are sure to bite your ass!

<g>

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/534A1F84.3000102@hawthorncottage.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 AndyHC
Back to top
Re: Bad getwordnum

Author: Gérard Lochon

Posted: 2014-04-13 01:28:32   Link

----- Original Message -----

From: "Allen" <profox@gatwicksoftware.com>

> I just spotted a nasty. GetWordNum. If you have say aa ="A,B,C,,,F" and ask

> for GetWordNum(aa,4,",") it gets it wrong. Seems it cannot handle blanks. A

> pain as I just had some.

Instead of using Getwordnum, split the string in an array using

ALINES(yourarray,yourstring,3,',')

You can then access to each word, even if it's a null string.

Gérard.

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/B95A2AD2C54841BD83A20E0DCA2BCCCC@MuriellePC

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Gérard Lochon
Back to top
RE: Bad getwordnum

Author: Allen

Posted: 2014-04-13 02:50:57   Link

So many ways to skin a cat. Thanks Gérard

Al

-----Original Message-----

From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Gérard

Lochon

Sent: 13 April 2014 08:29

To: profoxtech@leafe.com

Subject: Re: Bad getwordnum

----- Original Message -----

From: "Allen" <profox@gatwicksoftware.com>

> I just spotted a nasty. GetWordNum. If you have say aa ="A,B,C,,,F" and

ask

> for GetWordNum(aa,4,",") it gets it wrong. Seems it cannot handle blanks.

A

> pain as I just had some.

Instead of using Getwordnum, split the string in an array using

ALINES(yourarray,yourstring,3,',')

You can then access to each word, even if it's a null string.

Gérard.

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/001201cf56ed$1ba304a0$52e90de0$@com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Allen
Back to top
Re: Bad getwordnum

Author: Naushad Ali Ali

Posted: 2014-04-14 06:56:35   Link

Dears

I have a dbf file that file contain field is numeric and data has string

(Character). How to Handle for view, variable and print.

Regards

Naushad Ali

On Sat, Apr 12, 2014 at 10:54 PM, Mike Copeland <mike@ggisoft.com> wrote:

> Allen wrote:

>

>> Hi Mike

>> I have to disagree (my opinion). It may be intentional but it's a pain

>> and I

>> would call it either a bug or bad programming. For example CSV may not

>> always have anything between the commas. And you may not always have

>> control

>> of what is sent. In this instance I got over it but I wonder how many

>> other

>> places I have used GetWordNum and not even known it had failed. Before it

>> appeared in VFP I wrote my own, I wish I stuck with that now. At least

>> that

>> worked.

>> Al

>>

> Yep, I agree it's a pain. "Undocumented functionality" is always enjoyable

> (if you're a masochist.)

>

> Just add it to the list of "uhoh..." to avoid.

>

> And, yes, this is just my opinion. I'm sure someone finds this behavior to

> be "perfectly acceptable and expected."

>

> Mike

>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/CAL3VundLE=46JC0xx2vvjhd6k1t-06RyT80FhqELpNOxBGKe0Q@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Naushad Ali Ali
Back to top
RE: Bad getwordnum

Author: Richard Kaye

Posted: 2014-04-14 07:05:11   Link

Check the TRANSFORM function in the VFP Help file.

--

rk

-----Original Message-----

From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Naushad Ali Ali

Sent: Monday, April 14, 2014 7:57 AM

To: profoxtech@leafe.com

Subject: Re: Bad getwordnum

Dears

I have a dbf file that file contain field is numeric and data has string (Character). How to Handle for view, variable and print.

Regards

Naushad Ali

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/DF1EEF11E586A64FB54A97F22A8BD04422A745F8FA@ACKBWDDQH1.artfact.local

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2014 Richard Kaye