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

Extra /// from join(array, "/") 1

Status
Not open for further replies.

jenkoller

Programmer
Feb 11, 2005
14
US
I am trying to join a data element that is listed in the detail lines into one string array in the group footer. The problem is that I only need the distinct values which results in many characters used to separate the string at the end of the array. I need to trim the extra "///" before displaying the field. My formulas are as follows:

Formula #1
//Declare Formula
WhilePrintingRecords;
Global stringvar Array vProc;
Redim vProc[DistinctCount({@Procedure Type})];
Global Numbervar vCount := 0;

Formula #2
//Populate Formula
WhilePrintingRecords;
Global Stringvar Array vProc;
Global Numbervar vCount;

if not ({@Procedure Type} in vProc) then
(
vCount := vCount + 1;
vProc[vCount] := {@Procedure Type};
);

Formula #3
//Display Formula
WhilePrintingRecords;
Global StringVar Array vProc;
Join(vProc, "/")

The Result: TTE/3D///

I would like it to read: TTE/3D

Any help would be appreciated.

Jen
 
You can cheat it by wrapping the output in a replace statement:

replace(replace(Join(vProc, "/"),"//","/"),"//"/"/")

-k
 
This helps get me to a presentable format.

Thanks so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top