Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Searching a symbol
Message
From
27/10/2000 13:34:29
 
 
To
27/10/2000 13:27:53
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00435309
Message ID:
00435316
Views:
8
>Hello alls.
>I have a field called (phone) this has the format [(#####)-########], for sample (03564)-462193, where the firts numbers are the prefix and the others are the phone number. I need divide the field in two variables, just one before the (-) and before the (-). The problem is that not always the prefix has the same lengt. In consequence I dont know how many places count to divide the field.

Since you always have the "-", use AT() to get the position of it. e.g.

cFirstPart = LEFT(phone, AT("-", phone)-1)
cSecondPart = SUBSTR(phone, AT("_", phone)+1)
Insanity: Doing the same thing over and over and expecting different results.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform