Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ErrorHandle often gives 0 in the LINENO()
Message
From
06/05/2002 02:00:42
Walter Meester
HoogkarspelNetherlands
 
 
To
05/05/2002 23:01:55
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00652952
Message ID:
00652970
Views:
19
Hi, Virusim

Check the 'debug info' checkbox on the project manager. VFP, is only able to track the lineno when debug info is included.

Walter,

>
>My VFP6 written application had the error handle below
>to cater for any error in my program for ease of debugging
>and testing
>
>ON ERROR DO ERRORHANDLE WITH ERROR(), MESSAGE(), LINENO(), PROGRAM() < == in my main program
>
>
>PROCEDURE ErrorHandle(pvErrorno, pvMessage, pvLineno, pvProgram)
>
>
> LOCAL lPath, lFileHandle, lStr
>
> lPath = SYS(5)+CURDIR()
>
> IF FILE(lPath+'Error.log')
> lFileHandle = FOPEN(lPath+'Error.log',2)
> ELSE
> lFileHandle = FCREATE(lPath+'Error.log')
> ENDIF
>
> FSEEK(lFileHandle,0,2)
>
> lStr = 'Error on '+TTOC(DATETIME())
> FPUTS(lFileHandle,lStr,LEN(lStr))
>
> lStr = 'Program with Error '+pvProgram
> FPUTS(lFileHandle,lStr,LEN(lStr))
>
> lStr = 'Error No = '+ALLT(STR(pvErrorNo))
> FPUTS(lFileHandle,lStr,LEN(lStr))
>
> lStr = 'Error Message = '+pvMessage
> FPUTS(lFileHandle,lStr,LEN(lStr))
>
> lStr = 'Error Line = '+ALLT(STR(pvLineNo))
> FPUTS(lFileHandle,lStr,LEN(lStr))
>
> lStr = CHR(13)+CHR(10)
> FPUTS(lFileHandle,lStr,LEN(lStr))
>
> FCLOSE(lFileHandle)
>
>ENDPROC
>
>
>However, when my program encountered any error, the log file will
>only capture my program function/procedure name, but the lineno
>is always 0, what is wrong with my program coding. Please kindly
>advise me as this problem is giving headache as I can't pinpoint
>which line is giving me error.
>
>Thank you
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform