>Hi Gang!
>
>My fellow colleague at work has this problem. He has this in some code
>
>
>PROCEDURE getArrayElement
> PARAMETERS lnElement
> pcTheData = laWarnLbl[lnElement]
> RETURN pcTheData
>ENDPROC
>
>
>The above snippet of code is giving me the “invalid subscript reference” error on the “pcTheData = laWarnLbl[lnElement] line.
>
>The value of lnElement at this point is 1.
>
>And laWrnLbl is dimensioned to 6.
>
>Thanks
Change parameters to lparameters and also add a check for array dimension before accessing the element, e.g.
if between(lnElement, 1, alen(laWarnLbl,1))
....
endif
If it's not broken, fix it until it is.
My Blog