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

One long String from Different Lines

Status
Not open for further replies.

pator

MIS
Sep 28, 2004
17
IE
Hello All

I have 2 fields. In F1 an asterisk in F2 text on different lines.
Example
F1 F2
* text which is on different lines and I need to get this text into 1 long string.There could be numerous lines of text here.
* New line of text here

Can anyone please advise on how for each * in F1 I can loop through the text in F2 and put it into 1 long string eliminating the lines. There are no line feeds or carriage returns involved. The next asterisk defines the next sentence.

Regards
Pator
 
Are you trying to assemble a long string of text from various records? If so, you could try adapting something I wrote to collect postcodes:
Code:
// Accumulate using a formula field (suppressed) in the detail line.  Allow for nulls and blanks.
whileprintingrecords;
if not isnull({Recc.Postcode}) and {Recc.Postcode} <> " "
then stringvar pst := pst + {Recc.Postcode} +", "
else if length(pst) = 0 
then stringvar pst := pst + "Excluding blanks; "
else stringvar pst := pst
Code:
// Show in using a formula field in the group footer.
whileprintingrecords;
stringvar pst;
left(pst,len(pst)-2)
Code:
//  Clear using a formula field using in the group header.
whileprintingrecords;
stringvar pst := "";
Note that clearing in the footer avoids problems with group headers repeating on a new page, which does clear everything for the group. Provided the 'clear' is placed in the section AFTER the display, it will do them in that order.


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thank you Madawc for you reply , it was very helpful
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top