I have run into problems trying to create my first Crystal array in version 8.5. Can you please tell me what I am doing wrong from looking at the problems commented in italics within the formula codes. Thanks for any help you can give.
//INITARRAY is a formula in the Report Header //
// deptarray is the array for all the department names
// officearray are all the corresponding department numbers
// costdept is the accumulating totals for each department
// This checks out ok until the program executes and then //
// Get Error “A subscript must be between 1 and the size of the array.” //
// pointing at the very beginning just before the first shared //
shared stringvar array deptarray;
shared stringvar array office2array;
shared numbervar array costdept;
deptarray[1] := "";
office2array[1] := "";
costdept[1] := 0;
//DEPTTOTALARRAYS is formula to be put into detail //
numbervar acntr := 0;
numbervar max := UBound(deptarray);
// Get Error “The ) is missing” pointing after the ( and before deptarray in Ubound //
while acntr <= max Do
( acntr = acntr + 1;
If {IS_HelpDesk.sDepartment} = deptarray[acntr] Then
// Get Error “A number, currency amount, Boolean, date, time, or string is expected here” pointing at beginning of deptarray[acntr]. //
costdept[acntr] = costdept[acntr] + {@TotalCosts}
Else
deptarray[acntr] = {IS_HelpDesk.sDepartment}
office2array[acntr] = {IS_HelpDesk.sOffice2}
costdept[acntr] = {@TotalCosts}
);
//INITARRAY is a formula in the Report Header //
// deptarray is the array for all the department names
// officearray are all the corresponding department numbers
// costdept is the accumulating totals for each department
// This checks out ok until the program executes and then //
// Get Error “A subscript must be between 1 and the size of the array.” //
// pointing at the very beginning just before the first shared //
shared stringvar array deptarray;
shared stringvar array office2array;
shared numbervar array costdept;
deptarray[1] := "";
office2array[1] := "";
costdept[1] := 0;
//DEPTTOTALARRAYS is formula to be put into detail //
numbervar acntr := 0;
numbervar max := UBound(deptarray);
// Get Error “The ) is missing” pointing after the ( and before deptarray in Ubound //
while acntr <= max Do
( acntr = acntr + 1;
If {IS_HelpDesk.sDepartment} = deptarray[acntr] Then
// Get Error “A number, currency amount, Boolean, date, time, or string is expected here” pointing at beginning of deptarray[acntr]. //
costdept[acntr] = costdept[acntr] + {@TotalCosts}
Else
deptarray[acntr] = {IS_HelpDesk.sDepartment}
office2array[acntr] = {IS_HelpDesk.sOffice2}
costdept[acntr] = {@TotalCosts}
);