isoman4not5
isoman4not5

Reputation: 131

How do I reset a string array variable

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.

Upvotes: 2

Views: 984

Answers (3)

iMet
iMet

Reputation: 11

it is not possible Redim arr1[0];, because of error "dimensions must be between 1 and 1000". I try to assign a dummy blank array to reset arr1 as follows:

StringVar Array arr1;
Local StringVar Array dummy;
arr1 := dummy;

Upvotes: 0

isoman4not5
isoman4not5

Reputation: 131

Someone suggested to me I try:

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

And it worked

Upvotes: 2

K Emery
K Emery

Reputation: 101

Create a new formula putting the below code in, calling it reset or something along those lines and place it in the group header.

StringVar Array arr1;
Redim arr1[0];

However, you will have to put any outputs in the group footer for this to work as it resets all data at the start of a new group.

Upvotes: 0

Related Questions