×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • 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.

Students Click Here

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

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.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

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:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close