cancel
Showing results for 
Search instead for 
Did you mean: 

How to display values in an array using Crystal

Former Member
0 Kudos

I created an array with list of product names. I want to display the list. When the following runs, it simply shows me the last entry in the array, not the list of items in the array. I have this code in the report footer

whileprintingrecords;
Shared stringvar array premium;
numbervar x := 1;
stringvar showit;

for x := 1 to 5 do
(
showit := premium[x];
x := x+1;
);

showit;

If I move the last line to within the () then I get True as the response.

Accepted Solutions (0)

Answers (1)

Answers (1)

ido_millet
Active Contributor
0 Kudos
Shared stringvar array premium;
Join(premium, ",");
Former Member
0 Kudos

Thanks. I did not need all the additional coding for handling the loop. I made an adjustment to your answer and added the line break.

whileprintingrecords;
Shared stringvar array premium;

join(premium, ChrW(13));