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.
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.
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.
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.
+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.
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.
----- 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.
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.
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.
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.