You didn't say whether this occurs in the development environment or the run-time (EXE). If it only happens in the EXE, then the problem is you need to specify that you want to include Debug information when you create your EXE (from the VFP main menu, select Project - Project Info and check the Debug Info checkbox). Otherwise, VFP doesn't include the necesarry informatino in the EXE to track line numbers so it always returns 0.
HTH.
>Hi,
>
>I having some problem in using the function LINENO() with my
>error handling procedure. Insteads of returning me the line no
>where the code is giving error, it instead return me 0. I had
>play with it but in vain. I can't seem to get it to return the
>error code line when my application hit error. It either return
>0 or the line no in my error handle procedure which are both
>not what I want. I want it to know which function/procedure when
>hit error, will trigger my error handle and it will help to
>report the line no of the function/procedure. Please advise
>and help me with code example. Thank you very much
>
>Below is how I use it in my code
>
>ON Error DO ErrorHandler WITH ERROR(), MESSAGE(), MESSAGE(1), LINENO()
>
>
>PROCEDURE ErrorHandle(pvError, pvMessage, pvMessage1, pvLineNo)
>
> ? pvLineNo <------ this always return 0 or error handle line no
> when LINENO()/LINENO(1)
>
>ENDPROC
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao