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!

parse memo field in cr9 by line

Status
Not open for further replies.

mrichey

MIS
Nov 22, 2002
71
US
I would like to parse a memo field in CR9 by line. Ex:

now is the time for all good men
to come to the aid of their country
twas brillig and the slithy toes
did giran gimble and the wabe

How to I find the hard return at the end of each line? Can I use like instr(<fieldname>,"chr(13)") or anything like that?

I want to be able to pull each line out as it's own field.

Thank you!!
 
You should consider doing this on the database.

Since you didn't share that information, I can't help on that level.

Here's a means in Crystal to parse it into an array which can then be individually referenced:

stringvar Test := "now is the time for all good men"+chr(13)+
"to come to the aid of their country"+chr(13)+
"twas brillig and the slithy toes"+chr(13)+
"did giran gimble and the wabe"+chr(13);
stringvar array testarray := split(test,chr(13));
testarray[1]

Replace the actual text with your table.field.

Note that each line will be consecutively numbered in the array, and you can use ubound(arrayname) to get the maximum number of elements.

Hope this helps.

-k
 
You could use the split function
Global stringvar array MemoInLines :=
Split({table.memofield},chr(13));

But then what do you want to do with it?

After you have manipulated each entry you can use join to put it all back together again.

Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top