cancel
Showing results for 
Search instead for 
Did you mean: 

How do I reset a string array variable?

former_member279138
Participant
0 Kudos

I have a report with 4 different arrays.

All are set up like this

shared stringvar array arr1 := split({client_relations.sales_value}, "&");
'';

I need them to reset for each group. How do I do that? I tried something like this

WhilePrintingRecords;
shared stringvar array arr1 := " "; 

But I got an error saying the formula could not create an array.

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor

Hi Kurt,

Change the reset formula to:

WhilePrintingRecords;
shared stringvar array arr1 := "";
''; 

-Abhilash

former_member279138
Participant
0 Kudos

Thank you! That did it!

Answers (1)

Answers (1)

vitaly_izmaylov
Employee
Employee
0 Kudos

Use REDIM function.

See what Crystal HELP says:

When an array is re-dimensioned with Redim, elements in the array are filled with default values for that type

former_member279138
Participant
0 Kudos

How would I write that based on what I have?

vitaly_izmaylov
Employee
Employee
0 Kudos

WhilePrintingRecords;

shared stringvar array arr1[1];

Redim arr1 [1];

arr1 [1];