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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reseting an array 2

Status
Not open for further replies.

paulosinuk

IS-IT--Management
Feb 8, 2001
105
AU
I have an array that is populated providing a record a details level meets certain conditions. I then display the array in the group footer.

I want to be able to reset the array in the group footer so that it can be used in the next group without fear of amalgamation.

How do you reset/empty an array between groups?
 
Redim is the command to do this, although I have little experience with it. Check your help files. Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
In the Group header create an initialize formula

@initialize (suppressed)

WhilePrintingRecords;

if not inrepeatedGroupheader then
(
//make the array 50% bigger than any you currently
//expect to use
stringvar array yourArray := ["","","",....""];

//this counter will be used in assigning values to the
//array after each assignment you would increment the
//counter by one
numberVar icounter := 0;
);

if your array was numeric you would use
numbervar array yourArray := [0,0,0,....0];
Jim Broadbent
 
SV - Why "shared" array??? Also I think you should include a array counter as well in the reset so you start filling the array in order Jim Broadbent
 
Hmmm, guess I was thinking about some nasty lil arrays I was dealing with this weekend with that Shared...I usually explicitly state Global, though I don't think it's required, I believe its the default.

I have some arrays which use days of the year as their subscript to determine where values will be placed (a cheat for creating a calendar year effect when there isn't data for each day), they don't use counters at all, I figure if someone is working with an array, they understand how to subscript one.

<leapin everfaithfully>

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top