Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding a string value with a wildcard
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01367045
Message ID:
01367075
Views:
16
Hi Borislav,

I can't use your suggestion because the "@" sign may have multiple occurences within the memo field. But the one I want will be the first or second occurence of "@ 99.9999" and that is the one I need to locate. That's why I need a wildcard.

For example, ATC(" @ 99.9999", mymemofield) where the 99.9999 is a wildcard for numeric values.

>>Hello all,
>>
>>I am using the ATC() function to locate a substring within a memo field. I will find the string I am looking for and determine the starting position and length of the substring to return the needed substring. This was working because I assumed a certain character would never be used in the memo field and this character is now being used. Now I want to search for that string with only numeric values following it. For example, I want to extract a price from a memo field that has and '@' sign followed by a space and then some numeric value.
>>
>>Can I use the ATC() function to search for a string with a wildcard for numerics, and if so what is the wildcard? Or is there another function I can use to do this?
>>
>>TIA
>
>You ALWAYS, (ALWAYS!!!) have something like this:
>@ 123123.123asdasdasdasdasdasd
>
>Then you could use:
>
>?VAL(SUBSTR(YourMemo, ATC("@ ", YourMemo)+2))
>
>
>VAL function will remove all non numeric chars at the end of the expression.
>so if you have:
>
>lcStr = "bla bla @ 12324.55asdasdasd"
>?VAL(SUBSTR(lcStr, ATC("@ ", lcStr)+2)) && -> 12324.55
>
Previous
Reply
Map
View

Click here to load this message in the networking platform