Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

this code in the formula is behaving weird........

Status
Not open for further replies.

renukamh

Programmer
May 20, 2003
11
0
0
US
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)=&quot; &quot;) and (j+24 < LengthIssuer1 ) then
(
Issuer1_part:=mid(VarIssuer1,j,24);
j:=j+25;
i=i+1;
);
If (mid(VarIssuer1,j+24,1)<>&quot; &quot;) and (j+24 < LengthIssuer1 ) then
(
For l:=j+24 to j step -1 do
(
if mid(VarIssuer1,l,1)=&quot; &quot; then
(
Issuer1_part:=mid(VarIssuer1,j,l-j+1);
j:=l+1;
i=i+1;
exit for;
);
);
);
);

 
&quot;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 &quot;

The second line in your formula supplied IS setting VarIssuer1 to the value of {stp_cHoldingsPDF;1.issuer1}:

Local stringvar VarIssuer1:={stp_cHoldingsPDF;1.issuer1};

Perhaps you're getting a 0 or null value somewhere, or perhaps you supplied the wrong formula?

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top