chuckyfiche
IS-IT--Management
I would like to revisit a post from earlier in the year I just came across;
I've attempted to reproduce the formula to calculate the value of an array, based on it's position.
I'm failing on the exit statement, where Crystal is indicating it's waiting for a 'while' statement. I'm using Crystal 8.5.
I've kept the formula close to the original and followed the logic but still cannot get it to work. I would appreciate any suggestions the forum might have.
Michael
>>>>>>>>>>>>>>
if not({TABLE.PART} in PART_Array )then
(
sCounter := sCounter +1;
Redim Preserve PART_Array[sCounter];
Redim Preserve QTY_Array[sCounter];
PART_Array[sCounter] := {TABLE.PART};
NewQty := {@Available};
QTY_Array[sCounter] := NewQty;
)
else
(
max := ubound(PART_Array);
BooleanVar Flag := False;
While sCounter < max and Flag = false do
(
sCounter:=sCounter+1;
if{TABLE.PART} = PART_Array[sCounter] then
(
NewQty := QTY_Array[sCounter]-{TABLE.ORDER_QTY};
QTY_Array[sCounter] := NewQty;
Flag := True;
);
if Flag then exit do;
);
);
NewQty;
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
I've attempted to reproduce the formula to calculate the value of an array, based on it's position.
I'm failing on the exit statement, where Crystal is indicating it's waiting for a 'while' statement. I'm using Crystal 8.5.
I've kept the formula close to the original and followed the logic but still cannot get it to work. I would appreciate any suggestions the forum might have.
Michael
>>>>>>>>>>>>>>
if not({TABLE.PART} in PART_Array )then
(
sCounter := sCounter +1;
Redim Preserve PART_Array[sCounter];
Redim Preserve QTY_Array[sCounter];
PART_Array[sCounter] := {TABLE.PART};
NewQty := {@Available};
QTY_Array[sCounter] := NewQty;
)
else
(
max := ubound(PART_Array);
BooleanVar Flag := False;
While sCounter < max and Flag = false do
(
sCounter:=sCounter+1;
if{TABLE.PART} = PART_Array[sCounter] then
(
NewQty := QTY_Array[sCounter]-{TABLE.ORDER_QTY};
QTY_Array[sCounter] := NewQty;
Flag := True;
);
if Flag then exit do;
);
);
NewQty;
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<