----- Original Message -----
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]
Absolute awesome!!! This appear to be another "undocumented functionality", isn't it? (ALINES would be intended to split rows instead of words) Learning never stops.
I got burned by this a long time ago in that numbers are not considered words and we had sets of addresses in our document.
Just giving you a heads up.
On Tue, Jul 26, 2016 at 5:00 AM, Claudio canipotti@gmail.com wrote:
----- Original Message -----
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]
Hi Stephen,
Got an example where numbers aren't considered words in GETWORDNUM()?
Seems to work fine for me.
Fred
On Thu, Jul 28, 2016 at 6:59 AM, Stephen Russell srussell705@gmail.com wrote:
I got burned by this a long time ago in that numbers are not considered words and we had sets of addresses in our document.
Just giving you a heads up.
On Tue, Jul 26, 2016 at 5:00 AM, Claudio canipotti@gmail.com wrote:
----- Original Message -----
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]
Sorry Fred they were considered words when it was a numeric value when loaded in the array. We were extracting notes and there were addresses and times in there that muddied the waters.
On Thu, Jul 28, 2016 at 11:44 AM, Fred Taylor fbtaylor@gmail.com wrote:
Hi Stephen,
Got an example where numbers aren't considered words in GETWORDNUM()?
Seems to work fine for me.
Fred
On Thu, Jul 28, 2016 at 6:59 AM, Stephen Russell srussell705@gmail.com wrote:
I got burned by this a long time ago in that numbers are not considered words and we had sets of addresses in our document.
Just giving you a heads up.
On Tue, Jul 26, 2016 at 5:00 AM, Claudio canipotti@gmail.com wrote:
----- Original Message -----
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]
I am cautious of using getwordnum() for following reason.
Given:
lcString = "1,2,,3"
My observation is there are 4 separate words in that string using the comma as a separator - albeit one is null
? GETWORDCOUNT(m.lcString,",") - returns 3 ? OCCURS(",", m.lcString) + 1 - returns 4 ? ALINES(laLines, m.lcString, 3, ",") - returns 4
Guess it comes down to what a word is defined as.
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Stephen Russell Sent: Friday, 29 July 2016 4:44 AM To: profoxtech@leafe.com Subject: Re: Bad getwordnum
Sorry Fred they were considered words when it was a numeric value when loaded in the array. We were extracting notes and there were addresses and times in there that muddied the waters.
On Thu, Jul 28, 2016 at 11:44 AM, Fred Taylor fbtaylor@gmail.com wrote:
Hi Stephen,
Got an example where numbers aren't considered words in GETWORDNUM()?
Seems to work fine for me.
Fred
On Thu, Jul 28, 2016 at 6:59 AM, Stephen Russell srussell705@gmail.com wrote:
I got burned by this a long time ago in that numbers are not considered words and we had sets of addresses in our document.
Just giving you a heads up.
On Tue, Jul 26, 2016 at 5:00 AM, Claudio canipotti@gmail.com wrote:
----- Original Message -----
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]
The problem lies with consecutive commas. If you put a space between the commas after the 2 and before the one in front of the 3, it works OK.
?GETWORDCOUNT("1,2, ,3") && prints 4 ?GETWORDNUM("1,2, ,3",1,",") && prints "1" ?GETWORDNUM("1,2, ,3",2,",") && prints "2" ?GETWORDNUM("1,2, ,3",3,",") && prints " " ?GETWORDNUM("1,2, ,3",4,",") && prints "3"
Fred
On Thu, Jul 28, 2016 at 12:31 PM, Darren foxdev@ozemail.com.au wrote:
I am cautious of using getwordnum() for following reason.
Given:
lcString = "1,2,,3"
My observation is there are 4 separate words in that string using the comma as a separator - albeit one is null
? GETWORDCOUNT(m.lcString,",") - returns 3 ? OCCURS(",", m.lcString) + 1 - returns 4 ? ALINES(laLines, m.lcString, 3, ",") - returns 4
Guess it comes down to what a word is defined as.
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Stephen Russell Sent: Friday, 29 July 2016 4:44 AM To: profoxtech@leafe.com Subject: Re: Bad getwordnum
Sorry Fred they were considered words when it was a numeric value when loaded in the array. We were extracting notes and there were addresses and times in there that muddied the waters.
On Thu, Jul 28, 2016 at 11:44 AM, Fred Taylor fbtaylor@gmail.com wrote:
Hi Stephen,
Got an example where numbers aren't considered words in GETWORDNUM()?
Seems to work fine for me.
Fred
On Thu, Jul 28, 2016 at 6:59 AM, Stephen Russell srussell705@gmail.com wrote:
I got burned by this a long time ago in that numbers are not considered words and we had sets of addresses in our document.
Just giving you a heads up.
On Tue, Jul 26, 2016 at 5:00 AM, Claudio canipotti@gmail.com wrote:
----- Original Message -----
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]
So just make sure there are no consecutive commas first: DO WHILE ",," $ cStr cStr = strtran(cStr, ",,", ",") END DO
Mike
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Fred Taylor Sent: Thursday, July 28, 2016 3:25 PM To: profoxtech@leafe.com Subject: Re: Bad getwordnum
The problem lies with consecutive commas. If you put a space between the commas after the 2 and before the one in front of the 3, it works OK.
?GETWORDCOUNT("1,2, ,3") && prints 4 ?GETWORDNUM("1,2, ,3",1,",") && prints "1" ?GETWORDNUM("1,2, ,3",2,",") && prints "2" ?GETWORDNUM("1,2, ,3",3,",") && prints " " ?GETWORDNUM("1,2, ,3",4,",") && prints "3"
Fred
On Thu, Jul 28, 2016 at 12:31 PM, Darren foxdev@ozemail.com.au wrote:
I am cautious of using getwordnum() for following reason.
Given:
lcString = "1,2,,3"
My observation is there are 4 separate words in that string using the comma as a separator - albeit one is null
? GETWORDCOUNT(m.lcString,",") - returns 3 ? OCCURS(",", m.lcString) + 1 - returns 4 ? ALINES(laLines, m.lcString, 3, ",") - returns 4
Guess it comes down to what a word is defined as.
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Stephen Russell Sent: Friday, 29 July 2016 4:44 AM To: profoxtech@leafe.com Subject: Re: Bad getwordnum
Sorry Fred they were considered words when it was a numeric value when loaded in the array. We were extracting notes and there were addresses and times in there that muddied the waters.
On Thu, Jul 28, 2016 at 11:44 AM, Fred Taylor fbtaylor@gmail.com wrote:
Hi Stephen,
Got an example where numbers aren't considered words in GETWORDNUM()?
Seems to work fine for me.
Fred
On Thu, Jul 28, 2016 at 6:59 AM, Stephen Russell srussell705@gmail.com wrote:
I got burned by this a long time ago in that numbers are not considered words and we had sets of addresses in our document.
Just giving you a heads up.
On Tue, Jul 26, 2016 at 5:00 AM, Claudio canipotti@gmail.com wrote:
----- Original Message -----
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]
The "DO WHILE" approach is not optimal, not even exact, because you can have more than 2 consecutive commas.
One optimal and exact approach is using ALINES() indicating the comma as the separator and using the optional parameters to take out empty parameters, so the final array have only non-empty values. In the case that you want empty values too, then do not use the optional parameters of ALINES().
2016-07-28 23:47 GMT+02:00 Michael Glassman MHGlassman@pioneerdrama.com:
So just make sure there are no consecutive commas first: DO WHILE ",," $ cStr cStr = strtran(cStr, ",,", ",") END DO
Mike
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Fred Taylor Sent: Thursday, July 28, 2016 3:25 PM To: profoxtech@leafe.com Subject: Re: Bad getwordnum
The problem lies with consecutive commas. If you put a space between the commas after the 2 and before the one in front of the 3, it works OK.
?GETWORDCOUNT("1,2, ,3") && prints 4 ?GETWORDNUM("1,2, ,3",1,",") && prints "1" ?GETWORDNUM("1,2, ,3",2,",") && prints "2" ?GETWORDNUM("1,2, ,3",3,",") && prints " " ?GETWORDNUM("1,2, ,3",4,",") && prints "3"
Fred
On Thu, Jul 28, 2016 at 12:31 PM, Darren foxdev@ozemail.com.au wrote:
I am cautious of using getwordnum() for following reason.
Given:
lcString = "1,2,,3"
My observation is there are 4 separate words in that string using the comma as a separator - albeit one is null
? GETWORDCOUNT(m.lcString,",") - returns 3 ? OCCURS(",", m.lcString) + 1 - returns 4 ? ALINES(laLines, m.lcString, 3, ",") - returns 4
Guess it comes down to what a word is defined as.
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Stephen Russell Sent: Friday, 29 July 2016 4:44 AM To: profoxtech@leafe.com Subject: Re: Bad getwordnum
Sorry Fred they were considered words when it was a numeric value when loaded in the array. We were extracting notes and there were addresses and times in there that muddied the waters.
On Thu, Jul 28, 2016 at 11:44 AM, Fred Taylor fbtaylor@gmail.com
wrote:
Hi Stephen,
Got an example where numbers aren't considered words in GETWORDNUM()?
Seems to work fine for me.
Fred
On Thu, Jul 28, 2016 at 6:59 AM, Stephen Russell srussell705@gmail.com wrote:
I got burned by this a long time ago in that numbers are not considered words and we had sets of addresses in our document.
Just giving you a heads up.
On Tue, Jul 26, 2016 at 5:00 AM, Claudio canipotti@gmail.com
wrote:
----- Original Message -----
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]
I'm afraid I have to disagree with you, Fernando. The DO WHILE approach may not be optimal, but it does work. If you have three consecutive commas, for instance, the first two get changed to one comma on the first loop, leaving two consecutive commas. On the second loop, those are changed to one comma. Honest, the process works fine and executes very quickly in VFP. It's much faster than having to test each and every array element to see if it is empty.
Mike
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Fernando D. Bozzo Sent: Thursday, July 28, 2016 6:07 PM To: profoxtech@leafe.com Subject: Re: Bad getwordnum
The "DO WHILE" approach is not optimal, not even exact, because you can have more than 2 consecutive commas.
One optimal and exact approach is using ALINES() indicating the comma as the separator and using the optional parameters to take out empty parameters, so the final array have only non-empty values. In the case that you want empty values too, then do not use the optional parameters of ALINES().
2016-07-28 23:47 GMT+02:00 Michael Glassman MHGlassman@pioneerdrama.com:
So just make sure there are no consecutive commas first: DO WHILE ",," $ cStr cStr = strtran(cStr, ",,", ",") END DO
Mike
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Fred Taylor Sent: Thursday, July 28, 2016 3:25 PM To: profoxtech@leafe.com Subject: Re: Bad getwordnum
The problem lies with consecutive commas. If you put a space between the commas after the 2 and before the one in front of the 3, it works OK.
?GETWORDCOUNT("1,2, ,3") && prints 4 ?GETWORDNUM("1,2, ,3",1,",") && prints "1" ?GETWORDNUM("1,2, ,3",2,",") && prints "2" ?GETWORDNUM("1,2, ,3",3,",") && prints " " ?GETWORDNUM("1,2, ,3",4,",") && prints "3"
Fred
On Thu, Jul 28, 2016 at 12:31 PM, Darren foxdev@ozemail.com.au wrote:
I am cautious of using getwordnum() for following reason.
Given:
lcString = "1,2,,3"
My observation is there are 4 separate words in that string using the comma as a separator - albeit one is null
? GETWORDCOUNT(m.lcString,",") - returns 3 ? OCCURS(",", m.lcString) + 1 - returns 4 ? ALINES(laLines, m.lcString, 3, ",") - returns 4
Guess it comes down to what a word is defined as.
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Stephen Russell Sent: Friday, 29 July 2016 4:44 AM To: profoxtech@leafe.com Subject: Re: Bad getwordnum
Sorry Fred they were considered words when it was a numeric value when loaded in the array. We were extracting notes and there were addresses and times in there that muddied the waters.
On Thu, Jul 28, 2016 at 11:44 AM, Fred Taylor fbtaylor@gmail.com
wrote:
Hi Stephen,
Got an example where numbers aren't considered words in GETWORDNUM()?
Seems to work fine for me.
Fred
On Thu, Jul 28, 2016 at 6:59 AM, Stephen Russell srussell705@gmail.com wrote:
I got burned by this a long time ago in that numbers are not considered words and we had sets of addresses in our document.
Just giving you a heads up.
On Tue, Jul 26, 2016 at 5:00 AM, Claudio canipotti@gmail.com
wrote:
----- Original Message -----
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]
If leading and trailing spaces are not significant, instead of
?GETWORDNUM(yourstring,i,',')
use :
ch = strtran(yourstring,',',' , ')
?allt(GETWORDNUM(ch,i,',')
Gérard.
Le 29/07/2016 à 08:05, Michael Glassman a écrit :
I'm afraid I have to disagree with you, Fernando. The DO WHILE approach may not be optimal, but it does work. If you have three consecutive commas, for instance, the first two get changed to one comma on the first loop, leaving two consecutive commas. On the second loop, those are changed to one comma. Honest, the process works fine and executes very quickly in VFP. It's much faster than having to test each and every array element to see if it is empty.
Mike
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Fernando D. Bozzo Sent: Thursday, July 28, 2016 6:07 PM To: profoxtech@leafe.com Subject: Re: Bad getwordnum
The "DO WHILE" approach is not optimal, not even exact, because you can have more than 2 consecutive commas.
One optimal and exact approach is using ALINES() indicating the comma as the separator and using the optional parameters to take out empty parameters, so the final array have only non-empty values. In the case that you want empty values too, then do not use the optional parameters of ALINES().
2016-07-28 23:47 GMT+02:00 Michael Glassman MHGlassman@pioneerdrama.com:
So just make sure there are no consecutive commas first: DO WHILE ",," $ cStr cStr = strtran(cStr, ",,", ",") END DO
Mike
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Fred Taylor Sent: Thursday, July 28, 2016 3:25 PM To: profoxtech@leafe.com Subject: Re: Bad getwordnum
The problem lies with consecutive commas. If you put a space between the commas after the 2 and before the one in front of the 3, it works OK.
?GETWORDCOUNT("1,2, ,3") && prints 4 ?GETWORDNUM("1,2, ,3",1,",") && prints "1" ?GETWORDNUM("1,2, ,3",2,",") && prints "2" ?GETWORDNUM("1,2, ,3",3,",") && prints " " ?GETWORDNUM("1,2, ,3",4,",") && prints "3"
Fred
On Thu, Jul 28, 2016 at 12:31 PM, Darren foxdev@ozemail.com.au wrote:
I am cautious of using getwordnum() for following reason.
Given:
lcString = "1,2,,3"
My observation is there are 4 separate words in that string using the comma as a separator - albeit one is null
? GETWORDCOUNT(m.lcString,",") - returns 3 ? OCCURS(",", m.lcString) + 1 - returns 4 ? ALINES(laLines, m.lcString, 3, ",") - returns 4
Guess it comes down to what a word is defined as.
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Stephen Russell Sent: Friday, 29 July 2016 4:44 AM To: profoxtech@leafe.com Subject: Re: Bad getwordnum
Sorry Fred they were considered words when it was a numeric value when loaded in the array. We were extracting notes and there were addresses and times in there that muddied the waters.
On Thu, Jul 28, 2016 at 11:44 AM, Fred Taylor fbtaylor@gmail.com
wrote:
Hi Stephen,
Got an example where numbers aren't considered words in GETWORDNUM()?
Seems to work fine for me.
Fred
On Thu, Jul 28, 2016 at 6:59 AM, Stephen Russell srussell705@gmail.com wrote:
I got burned by this a long time ago in that numbers are not considered words and we had sets of addresses in our document.
Just giving you a heads up.
On Tue, Jul 26, 2016 at 5:00 AM, Claudio canipotti@gmail.com
wrote:
> ----- Original Message ----- > > 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]
At 23:05 2016-07-28, "Michael Glassman" MHGlassman@PioneerDrama.com wrote:
I'm afraid I have to disagree with you, Fernando. The DO WHILE approach may not be optimal, but it does work. If you have three consecutive commas, for instance, the first two get changed to one comma on the first loop, leaving two consecutive commas. On the second loop, those are changed to one comma. Honest, the process works fine and executes very quickly in VFP. It's much faster than having to test each and every array element to see if it is empty.
Depending on the length of the string, it might be worth building the new string to save grovelling part of the string again and again.
[snip]
Sincerely,
Gene Wirchenko
Stephen -- didn't you stop using VFP at version 6 back in 1999? LOL
On 2016-07-28 12:44, Fred Taylor wrote:
Hi Stephen,
Got an example where numbers aren't considered words in GETWORDNUM()?
Seems to work fine for me.
Fred
On Thu, Jul 28, 2016 at 6:59 AM, Stephen Russell srussell705@gmail.com wrote:
I got burned by this a long time ago in that numbers are not considered words and we had sets of addresses in our document.
Just giving you a heads up.
On Tue, Jul 26, 2016 at 5:00 AM, Claudio canipotti@gmail.com wrote:
----- Original Message -----
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]
Pretty much. A little consulting on the side but never realy wanted to do VFP code.
On Thu, Aug 4, 2016 at 6:20 PM, <mbsoftwaresolutions@mbsoftwaresolutions.com
wrote:
Stephen -- didn't you stop using VFP at version 6 back in 1999? LOL
On 2016-07-28 12:44, Fred Taylor wrote:
Hi Stephen,
Got an example where numbers aren't considered words in GETWORDNUM()?
Seems to work fine for me.
Fred
On Thu, Jul 28, 2016 at 6:59 AM, Stephen Russell srussell705@gmail.com wrote:
I got burned by this a long time ago in that numbers are not considered
words and we had sets of addresses in our document.
Just giving you a heads up.
On Tue, Jul 26, 2016 at 5:00 AM, Claudio canipotti@gmail.com wrote:
----- Original Message -----
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]
Doesn't know VFP, doesn't want to do VFP, but he still spouts out stuff on this list to VFP questions... <sigh>
-Charlie
On 8/4/2016 11:14 PM, Stephen Russell wrote:
Pretty much. A little consulting on the side but never realy wanted to do VFP code. On Thu, Aug 4, 2016 at 6:20 PM, <mbsoftwaresolutions@mbsoftwaresolutions.com
wrote: Stephen -- didn't you stop using VFP at version 6 back in 1999? LOL On 2016-07-28 12:44, Fred Taylor wrote:
Hi Stephen, Got an example where numbers aren't considered words in GETWORDNUM()? Seems to work fine for me. Fred On Thu, Jul 28, 2016 at 6:59 AM, Stephen Russell srussell705@gmail.com wrote: I got burned by this a long time ago in that numbers are not considered
words and we had sets of addresses in our document. Just giving you a heads up. On Tue, Jul 26, 2016 at 5:00 AM, Claudio canipotti@gmail.com wrote:
----- Original Message ----- 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]