Topic
  • 2 replies
  • Latest Post - ‏2014-07-21T09:31:04Z by MathiasLanglet
MathiasLanglet
MathiasLanglet
6 Posts

Pinned topic %Loopup index out of bounds

‏2014-07-21T07:47:09Z |

HI all,

I'm performing a lookup of an array in my program but I get array index out of bounds.

The List has 100 indexes. %lookup(56 : List(*).Field : 33 : 72)

How can this generate a RNX0121 error?

Thanks,

M

  • tuohyp
    tuohyp
    4 Posts

    Re: %Loopup index out of bounds

    ‏2014-07-21T08:58:37Z  

    Hi Mathias,

    In %lookup, parameter 3 is the start index and parameter 4 is the number of indexes. Starting at 33 for 72 indexes gives you up to 104 - hence RNX0121.

    I am guessing you want to scan from index 33 to 72 - in which case specify %lookup(56 : List(*).Field : 33 : 40)

    HTH

    Paul Tuohy

  • MathiasLanglet
    MathiasLanglet
    6 Posts

    Re: %Loopup index out of bounds

    ‏2014-07-21T09:31:04Z  
    • tuohyp
    • ‏2014-07-21T08:58:37Z

    Hi Mathias,

    In %lookup, parameter 3 is the start index and parameter 4 is the number of indexes. Starting at 33 for 72 indexes gives you up to 104 - hence RNX0121.

    I am guessing you want to scan from index 33 to 72 - in which case specify %lookup(56 : List(*).Field : 33 : 40)

    HTH

    Paul Tuohy

    Yeah now I feel stupid, thanks for sorting me out.

    /M