Re: Bad getwordnum

Author: Mike Copeland

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

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