Hello larsa
I was studying the sample files. And i found that the "Edit" sample have a bug. While runing the "Edit" sample, if the sheet cell is empty, and when click it, it show an error "raised exception class EConvertError with message ''' is not a vaild floating point value." I found the error in the code was appearing in
procedure TForm1.GridSelectCell(Sender: TObject; ACol, ARow: Integer; var CanSelect: Boolean);
begin
.....
if (EditCol = Grid.Col) and (EditRow = Grid.Row) then
SetCellValue(Grid.Col - 1,Grid.Row - 1);
end;
Could you please tell me how to solve this problem. Thank you.
Bug in Samples " Edit "
Re: Bug in Samples " Edit "
Hello
It's not an error. The exception occures only when your app is running from delphi. Read the code more carefully. If you don't like it, you can replace StrToFloat withTryStrToFloat.
It's not an error. The exception occures only when your app is running from delphi. Read the code more carefully. If you don't like it, you can replace StrToFloat withTryStrToFloat.
Lars Arvidsson, Axolot Data
-
- Posts: 3
- Joined: Wed Apr 25, 2012 12:04 pm
Re: Bug in Samples " Edit "
[quote="larsa"]Hello
It's not an error. The exception occures only when your app is running from delphi. Read the code more carefully. If you don't like it, you can replace StrToFloat withTryStrToFloat.[/quote]
Thank you larsa, i have solved this problem, but not in your methods. I used directly judgement "if ... else ..." in procedure SetCellValue, and drop the "try... except...". I think the problem cames from the indefinite cell keypress formation, because if edittext is all numbers it would be OK, but letter would be error. So i use directly judgement and solve the problem completely.
It's not an error. The exception occures only when your app is running from delphi. Read the code more carefully. If you don't like it, you can replace StrToFloat withTryStrToFloat.[/quote]
Thank you larsa, i have solved this problem, but not in your methods. I used directly judgement "if ... else ..." in procedure SetCellValue, and drop the "try... except...". I think the problem cames from the indefinite cell keypress formation, because if edittext is all numbers it would be OK, but letter would be error. So i use directly judgement and solve the problem completely.