Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Looping will not reset in Crystal 2008 Post Reply Post New Topic
Author Message
amanda5615
Newbie
Newbie


Joined: 20 Apr 2012
Location: United States
Online Status: Offline
Posts: 17
Quote amanda5615 Replybullet Topic: Looping will not reset in Crystal 2008
    Posted: 20 Apr 2012 at 5:47am
Hello, I am having issues with my loop with an array not resetting:
 
whileprintingrecords;
numberVar Array WorkOrders:= {@Total Workorders per account} ;
redim workorders[{@Total Workorders per account}];
numbervar counter;
stringvar ShowWorkorders;
for counter  :=  1 to Ubound (workorders)
Do(ShowWorkorders := showWorkorders +({vReport_workOrders_futureSMs_OASYS.workOrderID} + ', '));
showworkorders;
 
any tips?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 23 Apr 2012 at 4:50am
if you only need the array in this formula, add local to start...like:
local numbervar array WorkOrders...
 
I've heard that shared is the default condition, which would mean that it persists between calls to the formula.  I would have thought that the redim would clear it out to default values, but....
 
HTH
 
ps if you need the array in other places, you will need to create a reset function that will clear out the newly redimmed array.


Edited by lockwelle - 23 Apr 2012 at 4:51am
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.