How do I identify what code is generating " '' is not a valid floating point value" error dialogue box
I am using Delphi 2010 and have a program which keeps generating an error dialog box stating
开发者_Go百科'' is not a valid floating point value
How do I get delphi to show me the line that generated that error?
The easiest way to solve this is to run under the debugger and have it configured to Notify on language exceptions, Tools | Options:
Ignore the big list of exceptions to ignore that come from my own codebase. Just make sure the checkbox I have highlighted is marked.
Then when you run your program, it will stop at the line that causes the exception.
Search your code for StrToFloat function. This function raises an exception if the parameter is an empty string. You can replace the function call with:
if Trim(StrV) = '' then StrV := '0.0'; f := StrToFloat(StrV);
精彩评论