Here's what Ive Done so far
@Initialize
WhilePrintingRecords;
//Create 1000 values of "" in this array.
//it seems tedious but with copy and paste it is relatively easy
StringVar Array UsedIDS1 := "","...","";
StringVar Array UsedIDS2 := "","...","";
StringVar Array UsedIDS3 := "","...","";
StringVar Array UsedIDS4 := "","...","";
StringVar Array UsedIDS5 := "","...","";
StringVar Array UsedIDS6 := "","...","";
StringVar Array UsedIDS7 := "","...","";
StringVar Array UsedIDS8 := "","...","";
StringVar Array UsedIDS9 := "","...","";
StringVar Array UsedIDS10 := "","...","";
NumberVar Pointer := 0;
THIS WAS ACCEPTED AS NO ERRORS FOUND
This formula is NOT correct...though Crystal may have accepted it.
First (I have said this twice now) Array definitions require square brackets.
StringVar Array UsedIDS1 := ["","...",""];
Second this notation - "..." - is not a valid form in Crystal...it is just a short form for saying that many many more values are inserted here.
Here is how the statement should look for one of these arrays if I initialize it for 100 elements (you must do it for 1000 elements)
StringVar Array UsedIDS1 := ["","","","","","","","","","",
"","","","","","","","","","",
"","","","","","","","","","",
"","","","","","","","","","",
"","","","","","","","","","",
"","","","","","","","","","",
"","","","","","","","","","",
"","","","","","","","","","",
"","","","","","","","","","",
"","","","","","","","","",""];
You also have some useless (though non-fatal) brackets in the second formula
else if Pointer <= 4000 then
(
Temp := Pointer - 3000;
UsedIDS4[Temp] := {COMPSW.UNITID};
NOT
(UsedIDS4[Temp] := {COMPSW.UNITID}
)
else if Pointer <= 5000 then
You do this many times in the formula
Also
this first part ....while it isn't wrong...is hard to read at first glance...it is better written as follows
Pointer := Pointer + 1;
if Pointer <= 1000 then
(
UsedIDS1[Pointer] := {COMPSW.UNITID};
)
Hope this helps
Jim Broadbent