EvalError in TwwDatagrid

72 views
Skip to first unread message

Frank Ignoul

unread,
Aug 15, 2015, 5:56:28 AM8/15/15
to woll2woll.infopower
Hi Roy,

I've a TwwDatagrid linked to a time field. (datasource linked to a mysql database)
When the input is not a valid time value (for example 25:00) --> EvalError showed up in a loop.  So the application can only shutdown with a force quit.

How can I handle this?

Regards!

Frank
Schermafbeelding 2015-08-15 om 11.50.38.png

roy....@gmail.com

unread,
Aug 16, 2015, 12:14:34 PM8/16/15
to Frank Ignoul, woll2woll...@googlegroups.com
I can’t seem to reproduce your problem. What version of FirePower and Delphi are you using? When I have a time field, it won’t let me type 25 so I can’t even enter in the number as its over 24.

-Roy
--
You received this message because you are subscribed to the Google Groups "woll2woll.infopower" group.
To unsubscribe from this group and stop receiving emails from it, send an email to woll2wollinfopo...@googlegroups.com.
Visit this group at http://groups.google.com/group/woll2wollinfopower.
To view this discussion on the web visit https://groups.google.com/d/msgid/woll2wollinfopower/7e349c3c-b16a-4214-bca8-64269b84d8f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

lmc...@gmail.com

unread,
May 11, 2017, 2:18:26 PM5/11/17
to woll2woll.infopower
FROM: Bruce Balent

I'm having the same problem using a TwwDataGrid linked to a SQLite database table via a FireDAC TFDtable component with the app running it under Win32. The table has TimeAsStr and TimeAsReal fields with the TimeAsStr field being displayed in the grid for display and editing. The TimeAsStr column in the TwwDataGrid has the following properties:
AutoFill TRUE
ErrorMessage Not a valid time or time format
validationPictureMask [{' ',1}]#;:{0,1,2,3,4,5}#; {AM,PM}
The picture mask appears to work correctly. The TFDtable then fires this column's OnChange event; there I convert the string representation of a time into it's real representation (i.e. TempVariable := StrToDateTime(TimeAsStr.Value)) and store that TempVariable to that record's TimeAsReal field (i.e. a TFloatField). After that event completes successfully without error, the program calls dozens of inherited procedures eventually generating a EvalError; I haven't been able to pinpoint what command in what unit is triggering the error. Once I clear all the error dialogs generated by Delphi and the OS, the TwwDataGrid redisplays with the correct string value showing in the TimeAsStr field. When I look at the database using a database browser (DB Browser for SQLite) the real value representation of the time I just changed appears correct. So I don't know either what is causing the EvalError.

I am using Delphi 10.1 Update2 and FirePowerStudio_71_5_delphiberlin_updates
Delphi and my app are running on a Win7 Pro 64-bit notebook. After posting this, I will send you a zip file with the entire project in case it would help your troubleshooting.

Ditto: what's the fix or workaround for this apparently superflouous error?

Thanks
Bruce

Roy Woll

unread,
May 11, 2017, 3:35:42 PM5/11/17
to lmc...@gmail.com, woll2woll.infopower
Hi Bruce,

Its not clear to me why you need to have a string field in your database. The time/float field should be sufficient as it will then use the TwwCalendarEdit to edit the time portion. The grid can change the display format of the time based on your settings (i.e. - displayformat). If you have to do it the way you are doing, then I would use the OnSetText event to convert your text to a valid date/time, which is fired before its actually stored into your tfield.

-Roy
--
You received this message because you are subscribed to the Google Groups "woll2woll.infopower" group.
To unsubscribe from this group and stop receiving emails from it, send an email to woll2wollinfopo...@googlegroups.com.
Visit this group at https://groups.google.com/group/woll2wollinfopower.
To view this discussion on the web visit https://groups.google.com/d/msgid/woll2wollinfopower/290972cd-33ee-401b-94a7-ce345e2ff042%40googlegroups.com.

lmc...@gmail.com

unread,
May 12, 2017, 4:49:32 PM5/12/17
to woll2woll.infopower
On Saturday, August 15, 2015 at 2:56:28 AM UTC-7, Frank Ignoul wrote:
Roy,

I used a string field for displaying and editing time and a float field for sorting, because that's the method I'm familiar, and I had trouble getting the wwDataGrid to properly display & edit a DateTimeField and do the necessary formating (see remainder of this paragraph for a further discussion). I have a String field in the underlying SQLite table (meds) to control how the time is displayed and edited. Two TdataSets (FDmeds for editing and FDreminders for displaying medication reminders) connect to the underlying SQLite table (meds). During editing the FDmeds dataset connects to a TwwDataGrid (wwEditGrid). The FDmedsTakeAtStr is used for editing the time string displayed in this grid. When the user changes the view to display the Reminders grid (wwDataGrid1) I use the undisplayed real field (i.e. FDmedsMedTimeReal), which is an index field, so that I can sort and filter which meds table records are displayed.(i.e. those that are not marked as "taken" and which have a MedTimeReal value < now.

I tried catching the OnSetText event of my FDmedsTakeAtStr and setting the real value (i.e. FDmedsMedTimeReal.Value := StrToDateTime(Text); ) but I still get the same error. Delphi's HELP on using the OnSetText event wasn't helpful; can you tell me what I'm doing wrong trying to use that event?

Thanks
Bruce
Reply all
Reply to author
Forward
0 new messages