Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SCAN LOOP Goofing up
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01429392
Message ID:
01429418
Views:
42
Cecil,

Look at GetWordNum() function in Help instead of yours. It's already built in the language.

>ThisForm.GetWholeWords() grabs a string of words, complete words, and if you put a 2 in the second parameter (argument), you get the 2nd string of words. If you put a 1 int he 2nd parameter, you get the 1st string of words.
>
>Here's the code for the function:
>
>
>LPARAMETERS tcWords, tnStringNumber
>************************************************************
>* Parameters explained:
>*
>* tcWords  - Represents the entire string of words found
>* in the Description field that is 60-characters long.
>*
>* tnStringNumber - Represents the choice of getting either
>* the 1st or 2nd string.
>*
>* If tnStringNumber = 1, then we are getting the 1st string
>* of complete words.
>*
>* If tnStringNumber = 2, then we are getting the 2nd string
>* of words.
>************************************************************
>
>lcStr1=LEFT(tcWords, 30)
>lnSpace=RAT(" ",lcStr1)
>DO CASE
>	CASE tnStringNumber = 1
>		lcStr1=SUBSTR(tcWords, 1, lnSpace)
>		RETURN lcStr1
>
>	CASE tnStringNumber = 2
>		IF lnSpace=0
>			lcStr2=RIGHT(tcWords,30)
>			*?lcStr1,",",lcStr2
>			RETURN lcStr2
>		ELSE
>			lcStr2=SUBSTR(tcWords, lnSpace+1)
>			RETURN lcStr2
>		ENDIF
>ENDCASE
>
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform