Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Evaluating before a hyphen
Message
 
 
To
07/01/2003 13:07:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00738936
Message ID:
00738945
Views:
15
This message has been marked as a message which has helped to the initial question of the thread.
>Hey everyone,
>I am trying to evaluate some characters that come before a hyphen. Is there a way to evaluate those characters that come before a hyphen. Example:
>test-test1. Is there a way to look at this string and grab just "test" from it. Also, is there a way to look at this string and grab just "test1". Any help would be appreciated. Thanks.
The followinf sample code should get you started.
lcStr = "test-test1"
lnPos = AT("-", lcStr)
IF lnPos = 0
	WAIT WINDOW "No '-' found"
	RETURN
ENDIF
lcStr01 = LEFT(lcStr, lnPos-1)	
lcStr02 = SUBSTR(lcStr, lnPos+1)	

? lcStr01 
? lcStr02
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform