Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MegaFox 1002 (CalendarDemo form)
Message
From
01/02/2004 07:20:07
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00872703
Message ID:
00872758
Views:
41
Hello Steve.

Did you not get my responses in e-mail? If not, I am sorry - I have been having some e-mail trouble lately.

What does GETWORDCOUNT() do in version of vfp later than vfp 6.0 ?

GETWORDCOUNT( ) Function Counts the words in a string.

GetWordCount(cString[, cDelimiters])

Parameters
cString
Specifies the string whose words will be counted.

cDelimiters
Optional. Specifies one or more optional characters used to separate words in cString. The default delimiters are space, tab, carriage return, and line feed. Note that GetWordCount( ) uses each of the characters in cDelimiters as individual delimiters, not the entire string as a single delimiter.

Return Value
Numeric

Remarks
GetWordCount( ) by default assumes that words are delimited by spaces or tabs. If you specify another character as delimiter, this function ignores spaces and tabs and uses only the specified character.

If you use "AAA aaa, BBB bbb, CCC ccc." as the target string for GetWordCount( ), you can get all the following results.

cString = "AAA aaa, BBB bbb, CCC ccc."
? GetWordCount(cString) && 6 - character groups, delimited by " "
? GetWordCount(cString, ",") && 3 - character groups, delimited by ","
? GetWordCount(cString, ".") && 1 - character group, delimited by "."

If that's all it does, I'll write my own function.

Why re-invent the wheel? Just use foxTools like so:
SET LIBRARY TO ( HOME() + 'Foxtools.fll' ) ADDITIVE

*** Make sure that we do not have something like this:
*** ( Field1 + Field2 ) specified as the controlSource
IF ( AT( '(', .ControlSource ) = 0 ) AND ( WORDS( .ControlSource, '.' ) = 2 )
  .
  .
  .
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform