Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to extract 7-digits string in memo field?
Message
From
28/06/2000 13:39:27
 
 
To
28/06/2000 13:19:38
Chong Hanwah
Apic Systems Pteltd
Singapore, Singapore
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00385897
Message ID:
00385922
Views:
21
>Anyone knows a short and easy function to extract 7 digit string
>from a memo field ?

Look at using the Vbscript.RegExpn automation object, which supports regular expression parsing, something like:
*  Grab as many 7 digit strings as occur in this memo field instance
oRegExpn = CREATE('VBScript.RegExp')
oRegExpn.Global = .t.
oRegExpn.Pattern = "(\d{7})"
SCAN
   oSevenDigitStrings = oRegExpn.Execute(mMemoField)
   FOR EACH item IN oSevenDigitStrings
      ? item.value
   ENDFOR
ENDSCAN
WSH 2.0 must be installed on the target system to ensure that the VBScript.RegExp object will be available.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform