Not sure that helps me much. This is a foreign concept I'm trying to work myself through (arrays). What I've arrived at right now is to place another If statement outside the original array to try and limit the array to only values I'm looking for:
whileprintingrecords;
stringvar d:= {OBI_EquipmentMaster.Description};
numbervar p:= {DriveProjectionAndCollectedTotals.ProcedureProjection};
numbervar pe:= {DriveProjectionAndCollectedTotals.ProceduresPerformed};
numbervar et:= {OBI_EquipmentMaster.EquipmentType};
stringvar array ad;
numbervar array ap;
numbervar array ape;
numbervar c:=1;
numbervar c2:= 1;
numbervar n:=0;
// if statement to only include equipment type 3
if et=3
then
(
// check to see if the description has been added to the string array
// if not, add it plus add the initial projection value to the number arrays
//if not (d in ad) then
if not (d in ad) then
(
numbervar c:= c + 1;
redim preserve ad[c]; ad[c]:= d;
redim preserve ap[c]; ap[c]:= p;
redim preserve ape[c]; ape[c]:= pe;
)
else
// if the description is already in the array, find its position
// then add the new projection as a running total to the appropriate number array values
(
while c2 <= count(ad) do
(
if d = ad[c2] then (n := c2; exit while);
c2 := c2 + 1
);
ap[n]:= ap[n] + p;
ape[n]:= ape[n] + pe;
);
// grand running totals
numbervar gp:= gp + p;
numbervar gpe:= gpe + pe;
)
Believe that might have solved one problem, but now I'm getting the same error on another formula:
whileprintingrecords;
stringvar t:= GridRowColumnValue ("rpt_EquipmentMaster.Description");
numbervar et:= {OBI_EquipmentMaster.EquipmentType};
stringvar array ad;
numbervar array ap;
numbervar c3:= 1;
numbervar n2;
if et=3 then
(
while c3 <= count(ad) do
(
if t = ad[c3] then (n2 := c3; exit while);
c3 := c3 + 1
);
numbervar apn:= ap[n2];
totext(apn,0)
)
Which is part of my display string on the cross-tab I'm using.
Suggestions?
Thanks,