While wrapping can have benefits from hooking ability, just wrapping basic language functionality is a bad idea.
Switching your parameter order around you'd have getArrayElement(@laWarnLbl, 5), which could easily be optimised to laWarnLbl[5] ;-)
>
>If you have a field called lnElement in the active table, and it has a value greater than 6, you will get this error. I strongly advise you to alter this routine so that it uses LPARAMETERS. It should receive the array as a parameter too. It should declare pcTheData LOCAL or not even use pcTheData at all. I'd write it this way.
>
>
getArrayElement.prg
>LPARAMETERS lnElement,taArray
>EXTERNAL ARRAY taArray
>RETURN taArray[m.lnElement]
>
>and I'd call it like this
>
?GetArrayElement(5,@laWarnLbl)