Page 1 of 1

Error when FormatOptions.Enable := True and field is NULL

PostPosted: 18 May 2017 08:37
by INFOSYS
Hi,
this is the condition:

Code: Select all
  with IWCGJQEdit3 do begin
    datalink.dataSource := ServerController.UserSession.DataSource1;
    datalink.FieldName := 'val';
    FormatOptions.Enable := True;
    FormatOptions.AllowNegative := False;
    FormatOptions.AutoFix := True;
    FormatOptions.Precision := 0;
    FormatOptions.Type_ := ftDecimal;
  end;


When execute ServerController.UserSession.DataSource1.Post and the field 'val' (connected to IWCGJQEdit3 ) is NULL, an EConverError exception is fired with the
Note

"" is not a valid floating point value

message.

I know that
since 3.5.0.210, the component is using the system FormatSettings to convert string to float
but I think that if the field is null no exception must be fired...

Best Regards, Alfredo.

Re: Error when FormatOptions.Enable := True and field is NU

PostPosted: 18 May 2017 18:14
by Alexander Bulei
Hi Alfredo,

Fixed in next beta build.
Thank you.

Best Regards.

Re: Error when FormatOptions.Enable := True and field is NU

PostPosted: 19 May 2017 16:56
by INFOSYS
Hi Alexander,

I'm sorry but on 4.0.0.7 release the format error (when field is null) is still present...

Just checked out :-( on Delphi 10.2 and Intraweb 14.1.13

Best Regards, Alfredo.

Re: Error when FormatOptions.Enable := True and field is NU

PostPosted: 22 May 2017 14:47
by Alexander Bulei
Hi INFOSYS,

Please check the attached demo.

Best Regards.

Re: Error when FormatOptions.Enable := True and field is NU

PostPosted: 22 May 2017 15:10
by INFOSYS
Hi,

compiled your demo changing output folder only.

Same error when I post with IWCGJQEdit2.Text empty

error.png


and

error.png


:?

Best Regards, Alfredo.

Re: Error when FormatOptions.Enable := True and field is NU

PostPosted: 22 May 2017 15:16
by Alexander Bulei
Hi INFOSYS ,

Same error when I post with IWCGJQEdit2.Text empty


The demo, which I attached on previous post, work as expected in latest version..
Are you sure that you use the latest one?

Best Regards.

Re: Error when FormatOptions.Enable := True and field is NU

PostPosted: 22 May 2017 15:26
by INFOSYS
Hi, Alexander,

wwwroot: 4.0.0.7
CGDevTools: 4.0.0.7
Intraweb: 14.1.13
Delphi 10.2 w HotFix
S.O. Windows 10 Pro 1607 (OS Build 14393.1198) En

I put compiled JQDEV_XE4.exe in demo-bin folder of CGDevTools demo folder (IWCGJQComps\demo-bin) and I got the error..,

Alf.

Re: Error when FormatOptions.Enable := True and field is NU

PostPosted: 24 May 2017 12:03
by INFOSYS
Hi,
just installed new 4.0.0.9 CGDevTools version and your demo now works as expected (no more floating poin conversion errror).

BUT

compiled on 64 bit It's OK, when I compile on 32 bit I got an external exception executing (after run):
Exception.png


Alf.

Re: Error when FormatOptions.Enable := True and field is NU

PostPosted: 24 May 2017 14:19
by Jorge Sousa
Hi

Just debug the program to know where that error comes from

Re: Error when FormatOptions.Enable := True and field is NU

PostPosted: 26 May 2017 10:50
by Alexander Bulei
Hi INFOSYS,

Please try the latest beta build and let me know if the problem still persist...

Best Regards.