blairacuda
Technical User
Hello All,
I am having some trouble with Arrays in Crystal 8.
This code:
__________________________
NumberVar Array aCut[1];
StringVar print:="";
NumberVar arrayCount:=0;
Local NumberVar i;
if {@IsElbow} then
(
Redim aCut[4];
aCut[1]:={@S1};
aCut[2]:={@S2};
aCut[3]:={@H1};
aCut[4]:={@H2};
);
if {@IsStraight} then
(
Redim aCut[1];
aCut[1]:=888;
);
if {@IsTransition} then
(
Redim aCut[1];
aCut[1]:=999;
);
arrayCount:=UBound(aCut);
for i:=1 to arrayCount do
(
print:= print + ToText(aCut) + chr(13);
);
print;
_________________________________________________
results with this error: "A subscript must be between 1 and the size of the array."
The only way I can get it to work is if I take the Redim out of the if statement; even though the if statement is true.
At a loss.
Thanks in advance.
I am having some trouble with Arrays in Crystal 8.
This code:
__________________________
NumberVar Array aCut[1];
StringVar print:="";
NumberVar arrayCount:=0;
Local NumberVar i;
if {@IsElbow} then
(
Redim aCut[4];
aCut[1]:={@S1};
aCut[2]:={@S2};
aCut[3]:={@H1};
aCut[4]:={@H2};
);
if {@IsStraight} then
(
Redim aCut[1];
aCut[1]:=888;
);
if {@IsTransition} then
(
Redim aCut[1];
aCut[1]:=999;
);
arrayCount:=UBound(aCut);
for i:=1 to arrayCount do
(
print:= print + ToText(aCut) + chr(13);
);
print;
_________________________________________________
results with this error: "A subscript must be between 1 and the size of the array."
The only way I can get it to work is if I take the Redim out of the if statement; even though the if statement is true.
At a loss.
Thanks in advance.