×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

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

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

(OP)
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;
);
);
);
);

### RE: this code in the formula is behaving weird........

"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 "

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

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!