Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

string manipulation 1

Status
Not open for further replies.

angiem

MIS
Sep 29, 2000
116
CA
I have an address field of 255 char that needs to be exported to csv in 2 fields of 50 char, using only whole words in both fields, any ideas please.
 
NumberVar BreakPoint ;
//find the last space before 50 characters
If Length({AddressField}) > 50 then
BreakPoint := InStrRev(50, {AddressField}, " ")
Else
BreakPoint := 0 ;
// print out the first field
If BreakPoint > 0 then
{AddressField}[1 to BreakPoint]
Else
{AddressField}

In another formula, print out the second half
NumberVar BreakPoint ;
If BreakPoint > 0 then
{AddressField}[(BreakPoint + 1) to Length({AddressField})]
Else
""
Malcolm
 
Hi
I tried this but I'm using CR7 and no Instrrev available.

Any other ideas

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top