Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
StrExtract()
Message
From
04/06/2008 17:10:24
 
 
To
04/06/2008 14:14:23
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01321672
Message ID:
01321747
Views:
19
>I want to extract the string between the asterisks, or between an asterisk and the tilde if it's the last occurrence. If I use StrExtract() with occurrences from 1 to 4, I get "4" "3" "23" and "0" as results in the example below.
>
>m.test = "HL*4*3*23*0~"
>
>This evaluates to "" because there is no second asterisk for the fourth occurrence:
>
>m.String = STREXTRACT(m.test, "*", "*", 4)

What about using GETWORDNUM?
FOR m.nNdx=1 TO GETWORDCOUNT(m.test,"*~")
  m.String = GETWORDNUM(m.test,m.nNdx,"*~")
  ?? m.String
ENDFOR
Previous
Reply
Map
View

Click here to load this message in the networking platform