Hi Kenneth,
>I've fixed this problem by using a parameter object but would like to see if someone can explain why this happens.
>
>I have a UDF:
>
>
>FunctionX
>
>Parameter pArray
>
>For nCnt=1 to aLen(pArray,1)
> Seek(pArray[nCnt,1],"ATABLE")
>EndFOr
>
>Return
>
>
>This work:
>
>FX="FunctionX(@myarray)"
>&FX
>
>This causes an error:
>
>FX="FunctionX(@myarray)"
>Select * From SomeTable Where &FX to cursor SomeCursor
>
>The error come from the UDF saying that pArray.prg is not found.
>
>Any ideas?
What should FunctionX return and what should it do? Move the pointer on the specific record? How is it related with your SQL.
Anyway, if it returns logical expression, you can simplify your life this way:
llRetValue=FunctionX(@myarray)
SELECT * From SomeTable Where llRetValue to cursor SomeCursor
Does it work?
If it's not broken, fix it until it is.
My Blog