Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Matching on verriable length data.
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00381819
Message ID:
00381881
Views:
17
This is the "Brute Force" method of getting the match. There has to be a better way... doesn't there?

LPARAMETERS cDialedNumber
LOCAL nCountryId

IF NOT SEEK(LEFT(cDialedNumber, 7), 'countries', 'ccode')
IF NOT SEEK(LEFT(cDialedNumber, 6), 'countries', 'ccode')
IF NOT SEEK(LEFT(cDialedNumber, 5), 'countries', 'ccode')
IF NOT SEEK(LEFT(cDialedNumber, 4), 'countries', 'ccode')
nCountryId = 0 && Invalid country code
ELSE
nCountryId = countries.id
ENDIF
ELSE
nCountryId = countries.id
ENDIF
ELSE
nCountryId = countries.id
ENDIF
ELSE
nCountryId = countries.id
ENDIF

RETURN nCountryId
Thanx,
Bill Elvin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform