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!

Trimming characters after displaying array by join function

Status
Not open for further replies.

jenkoller

Programmer
Feb 11, 2005
14
US
I have created an array. I have written a formula that displays the result of the array using the join function. Some of the results end with lastname, firstname///// . My question is: How do I get rid of the /// at the end of the name. Details follow:

Declare Formula
WhilePrintingRecords;
Global stringvar Array vOperator;
Redim vOperator[DistinctCount({StudyClinicians.ClinicianRole})];
Global Numbervar vCountOperator := 0;

Populate Formula
WhilePrintingRecords;
Global Numbervar vCountOperator ;
Global Stringvar Array vOperator ;

if {@Operator} <> "NULL" then
if not ({StudyClinicians.ClinicianFullName} in vOperator) then
(
vCountOperator := vCountOperator + 1;
vOperator[vCountOperator] := {@Operator} ;
) ;

Display Formula
WhilePrintingRecords;
Global StringVar Array vOperator;
Join(vOperator, "/")

Result (1 of many)
Smith,John////
 
I'm guessing that you are using these formulas at the group level. You need to change your declaration formula to:

WhilePrintingRecords;
Global stringvar Array vOperator;
Redim vOperator[DistinctCount({StudyClinicians.ClinicianRole},{table.groupfield})];
Global Numbervar vCountOperator := 0;

...substituting your groupfield for {table.groupfield}.

-LB
 
Thank you for your reply. I tried what you advised and get the error "An array's dimension must be an integer between 1 and 1000"

Any other suggestions?

Jennifer
 
What is the content of {@operator}? What is your group field? I think one problem is that you are determining the array dimension by one field {StudyClinicians.ClinicianRole} even though you accumulating based on {@Operator}. Similarly, you are checking for the presence of {StudyClinicians.ClinicianFullName} instead of {@Operator}. Ordinarily you would use the same field in all three areas. Can the Clinician Role field be null?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top