Skip to Content
avatar image
Former Member

How to display values in an array using Crystal

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 22, 2017 at 04:59 PM
    Shared stringvar array premium;
    Join(premium, ",");
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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));