Problem: Whenever I replace the value of VarIssuer1 with the value of {stp_cHoldingsPDF;1.issuer1} it runs smoothly but when I run this I get the following error
Error :"A subscript must be between 1 and the size of the array"
//Formula issuer_part
Local numbervar LengthIssuer1;
Local stringvar VarIssuer1:={stp_cHoldingsPDF;1.issuer1};
Global stringvar array Issuer1_part:=['','','','','',''];
//partition for issuer1
Local numbervar i:=1;
Local numbervar j:=1;
Local numbervar l:=0;
LengthIssuer1:=Length(VarIssuer1);
While j<= LengthIssuer1 do
(
If j+24 > LengthIssuer1 then
(
Issuer1_part:= mid(VarIssuer1,j,LengthIssuer1-j+1);
j:=j+24;
i:=i+1;
exit while;
);
If (mid(VarIssuer1,j+24,1)=" "
and (j+24 < LengthIssuer1 ) then
(
Issuer1_part:=mid(VarIssuer1,j,24);
j:=j+25;
i=i+1;
);
If (mid(VarIssuer1,j+24,1)<>" "
and (j+24 < LengthIssuer1 ) then
(
For l:=j+24 to j step -1 do
(
if mid(VarIssuer1,l,1)=" " then
(
Issuer1_part:=mid(VarIssuer1,j,l-j+1);
j:=l+1;
i=i+1;
exit for;
);
);
);
);
Error :"A subscript must be between 1 and the size of the array"
//Formula issuer_part
Local numbervar LengthIssuer1;
Local stringvar VarIssuer1:={stp_cHoldingsPDF;1.issuer1};
Global stringvar array Issuer1_part:=['','','','','',''];
//partition for issuer1
Local numbervar i:=1;
Local numbervar j:=1;
Local numbervar l:=0;
LengthIssuer1:=Length(VarIssuer1);
While j<= LengthIssuer1 do
(
If j+24 > LengthIssuer1 then
(
Issuer1_part:= mid(VarIssuer1,j,LengthIssuer1-j+1);
j:=j+24;
i:=i+1;
exit while;
);
If (mid(VarIssuer1,j+24,1)=" "
(
Issuer1_part:=mid(VarIssuer1,j,24);
j:=j+25;
i=i+1;
);
If (mid(VarIssuer1,j+24,1)<>" "
(
For l:=j+24 to j step -1 do
(
if mid(VarIssuer1,l,1)=" " then
(
Issuer1_part:=mid(VarIssuer1,j,l-j+1);
j:=l+1;
i=i+1;
exit for;
);
);
);
);