dbTalk Databases Forums  

VFP9: Parsing a String

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss VFP9: Parsing a String in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gene Wirchenko
 
Posts: n/a

Default VFP9: Parsing a String - 06-18-2008 , 09:58 PM






Is there a function for parsing a comma-delimited string into an
array of substrings? I thought there was, but I can not find it in
the docs.

Example: "abc,,def,ghi," would return an array of elements:
"abc"
""
"def"
"ghi"
""

Sincerely,

Gene Wirchenko

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

Reply With Quote
  #2  
Old   
Jack Jackson
 
Posts: n/a

Default Re: VFP9: Parsing a String - 06-19-2008 , 12:29 AM






On Wed, 18 Jun 2008 19:58:06 -0700, Gene Wirchenko <genew (AT) ocis (DOT) net>
wrote:

Quote:
Is there a function for parsing a comma-delimited string into an
array of substrings? I thought there was, but I can not find it in
the docs.

Example: "abc,,def,ghi," would return an array of elements:
"abc"
""
"def"
"ghi"
""

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
ALINES has an option to specify the delimiter in newer versions.

There is also GETWORDNUM and GETWORDCOUNT.

However, you have to be careful about your requirement to get empty
items. GETWORDNUM/GETWORDCOUNT ignore empty items - they treat a
single delimiter the same as multiple delimiters in a row. I suppose
that comes from them originally only using space as the delimiter. I
think ALINES will keep the empty ones, but you need to check.


Reply With Quote
  #3  
Old   
Jack Jackson
 
Posts: n/a

Default Re: VFP9: Parsing a String - 06-19-2008 , 12:29 AM



On Wed, 18 Jun 2008 19:58:06 -0700, Gene Wirchenko <genew (AT) ocis (DOT) net>
wrote:

Quote:
Is there a function for parsing a comma-delimited string into an
array of substrings? I thought there was, but I can not find it in
the docs.

Example: "abc,,def,ghi," would return an array of elements:
"abc"
""
"def"
"ghi"
""

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
ALINES has an option to specify the delimiter in newer versions.

There is also GETWORDNUM and GETWORDCOUNT.

However, you have to be careful about your requirement to get empty
items. GETWORDNUM/GETWORDCOUNT ignore empty items - they treat a
single delimiter the same as multiple delimiters in a row. I suppose
that comes from them originally only using space as the delimiter. I
think ALINES will keep the empty ones, but you need to check.


Reply With Quote
  #4  
Old   
Jack Jackson
 
Posts: n/a

Default Re: VFP9: Parsing a String - 06-19-2008 , 12:29 AM



On Wed, 18 Jun 2008 19:58:06 -0700, Gene Wirchenko <genew (AT) ocis (DOT) net>
wrote:

Quote:
Is there a function for parsing a comma-delimited string into an
array of substrings? I thought there was, but I can not find it in
the docs.

Example: "abc,,def,ghi," would return an array of elements:
"abc"
""
"def"
"ghi"
""

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
ALINES has an option to specify the delimiter in newer versions.

There is also GETWORDNUM and GETWORDCOUNT.

However, you have to be careful about your requirement to get empty
items. GETWORDNUM/GETWORDCOUNT ignore empty items - they treat a
single delimiter the same as multiple delimiters in a row. I suppose
that comes from them originally only using space as the delimiter. I
think ALINES will keep the empty ones, but you need to check.


Reply With Quote
  #5  
Old   
Jack Jackson
 
Posts: n/a

Default Re: VFP9: Parsing a String - 06-19-2008 , 12:29 AM



On Wed, 18 Jun 2008 19:58:06 -0700, Gene Wirchenko <genew (AT) ocis (DOT) net>
wrote:

Quote:
Is there a function for parsing a comma-delimited string into an
array of substrings? I thought there was, but I can not find it in
the docs.

Example: "abc,,def,ghi," would return an array of elements:
"abc"
""
"def"
"ghi"
""

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
ALINES has an option to specify the delimiter in newer versions.

There is also GETWORDNUM and GETWORDCOUNT.

However, you have to be careful about your requirement to get empty
items. GETWORDNUM/GETWORDCOUNT ignore empty items - they treat a
single delimiter the same as multiple delimiters in a row. I suppose
that comes from them originally only using space as the delimiter. I
think ALINES will keep the empty ones, but you need to check.


Reply With Quote
  #6  
Old   
Jack Jackson
 
Posts: n/a

Default Re: VFP9: Parsing a String - 06-19-2008 , 12:29 AM



On Wed, 18 Jun 2008 19:58:06 -0700, Gene Wirchenko <genew (AT) ocis (DOT) net>
wrote:

Quote:
Is there a function for parsing a comma-delimited string into an
array of substrings? I thought there was, but I can not find it in
the docs.

Example: "abc,,def,ghi," would return an array of elements:
"abc"
""
"def"
"ghi"
""

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
ALINES has an option to specify the delimiter in newer versions.

There is also GETWORDNUM and GETWORDCOUNT.

However, you have to be careful about your requirement to get empty
items. GETWORDNUM/GETWORDCOUNT ignore empty items - they treat a
single delimiter the same as multiple delimiters in a row. I suppose
that comes from them originally only using space as the delimiter. I
think ALINES will keep the empty ones, but you need to check.


Reply With Quote
  #7  
Old   
Jack Jackson
 
Posts: n/a

Default Re: VFP9: Parsing a String - 06-19-2008 , 12:29 AM



On Wed, 18 Jun 2008 19:58:06 -0700, Gene Wirchenko <genew (AT) ocis (DOT) net>
wrote:

Quote:
Is there a function for parsing a comma-delimited string into an
array of substrings? I thought there was, but I can not find it in
the docs.

Example: "abc,,def,ghi," would return an array of elements:
"abc"
""
"def"
"ghi"
""

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
ALINES has an option to specify the delimiter in newer versions.

There is also GETWORDNUM and GETWORDCOUNT.

However, you have to be careful about your requirement to get empty
items. GETWORDNUM/GETWORDCOUNT ignore empty items - they treat a
single delimiter the same as multiple delimiters in a row. I suppose
that comes from them originally only using space as the delimiter. I
think ALINES will keep the empty ones, but you need to check.


Reply With Quote
  #8  
Old   
Jack Jackson
 
Posts: n/a

Default Re: VFP9: Parsing a String - 06-19-2008 , 12:29 AM



On Wed, 18 Jun 2008 19:58:06 -0700, Gene Wirchenko <genew (AT) ocis (DOT) net>
wrote:

Quote:
Is there a function for parsing a comma-delimited string into an
array of substrings? I thought there was, but I can not find it in
the docs.

Example: "abc,,def,ghi," would return an array of elements:
"abc"
""
"def"
"ghi"
""

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
ALINES has an option to specify the delimiter in newer versions.

There is also GETWORDNUM and GETWORDCOUNT.

However, you have to be careful about your requirement to get empty
items. GETWORDNUM/GETWORDCOUNT ignore empty items - they treat a
single delimiter the same as multiple delimiters in a row. I suppose
that comes from them originally only using space as the delimiter. I
think ALINES will keep the empty ones, but you need to check.


Reply With Quote
  #9  
Old   
Jack Jackson
 
Posts: n/a

Default Re: VFP9: Parsing a String - 06-19-2008 , 12:29 AM



On Wed, 18 Jun 2008 19:58:06 -0700, Gene Wirchenko <genew (AT) ocis (DOT) net>
wrote:

Quote:
Is there a function for parsing a comma-delimited string into an
array of substrings? I thought there was, but I can not find it in
the docs.

Example: "abc,,def,ghi," would return an array of elements:
"abc"
""
"def"
"ghi"
""

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
ALINES has an option to specify the delimiter in newer versions.

There is also GETWORDNUM and GETWORDCOUNT.

However, you have to be careful about your requirement to get empty
items. GETWORDNUM/GETWORDCOUNT ignore empty items - they treat a
single delimiter the same as multiple delimiters in a row. I suppose
that comes from them originally only using space as the delimiter. I
think ALINES will keep the empty ones, but you need to check.


Reply With Quote
  #10  
Old   
Jack Jackson
 
Posts: n/a

Default Re: VFP9: Parsing a String - 06-19-2008 , 12:29 AM



On Wed, 18 Jun 2008 19:58:06 -0700, Gene Wirchenko <genew (AT) ocis (DOT) net>
wrote:

Quote:
Is there a function for parsing a comma-delimited string into an
array of substrings? I thought there was, but I can not find it in
the docs.

Example: "abc,,def,ghi," would return an array of elements:
"abc"
""
"def"
"ghi"
""

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
ALINES has an option to specify the delimiter in newer versions.

There is also GETWORDNUM and GETWORDCOUNT.

However, you have to be careful about your requirement to get empty
items. GETWORDNUM/GETWORDCOUNT ignore empty items - they treat a
single delimiter the same as multiple delimiters in a row. I suppose
that comes from them originally only using space as the delimiter. I
think ALINES will keep the empty ones, but you need to check.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.