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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse Memo Field in CR Version 9 1

Status
Not open for further replies.

mrichey

MIS
Nov 22, 2002
71
US
I have a memo field (in ver 9) that is pulled in from the database vertically:

156
364
796
357

Is there any way to get the data horizontal (I know, lots of liquor) I'm able to use MID to extract each separately ...
mid ({probsummarym1.client.multi},6,5)
mid ({probsummarym1.client.multi},11,5), etc.

My list sometimes has 50 client numbers and I don't want to create 50 mid formulas. Any way to get this into one formula? I tried:
mid ({probsummarym1.client.multi},6,5) & mid ({probsummarym1.client.multi},11,5) but it stacked it vertically again.

Thanks for any help you can give me!

Mark
 
why are you returning 5 characters? Your data only shows 3. Does it sometimes have a many as 5 characters? My guess is that the 5th character is Chr(13), causing the "vertical" stacking. If, instead, you use 4 characters in your mid function, what happens? Your formula would look like:

mid ({probsummarym1.client.multi},6,4) & mid ({probsummarym1.client.multi},11,4)

Actually, it's possible you have a leading Chr(13), so maybe you need:

mid ({probsummarym1.client.multi},7,4) & mid ({probsummarym1.client.multi},12,4)
 
Very cool! You guys are good. I a novice programmer and know nothing about a chr(13). You have solved what has been a very big thorn in our sides ... reducing the size of our reports considerably. Thank you very much!
 
Another approach you might try, instead of using a bunch of mid functions (since you would have a lot to create), is to use a formula such as:

WhileReadingRecords;
local stringvar myField := {probsummarym1.client.multi};
local stringvar myTemp;
local numbervar ChrPosition;

While Instr(myField,Chr(13)) > 0 Do
(ChrPosition := Instr(myField,Chr(13));
myTemp := myTemp + Mid(myField,1,ChrPosition -1) + " ";
myField := Mid(myField,chrPosition + 2);
);
myTemp

(I tried using the Replace function, which would have been a lot simpler, but it didn't want to replace the Chr(13). Go figure.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top