#1  
Old 29th April 2015, 11:37 PM
denisprince denisprince is offline
Junior Member
 
Join Date: Aug 2011
Posts: 12
Default EM Code generator and dates with default values

Hi,

Using EM source code generator to get the dictionary to use for restructuring tables, if I have a date with a default value descriptor (not a TnxCurrentDateTimeDefaultValueDescriptor) then this is the code that is generated:

// Test
function __Test(aDatabase : TnxDatabase): TnxDataDictionary;
begin
Result := TnxDataDictionary.Create;
try
with Result do begin
AddRecordDescriptor(TnxBaseRecordDescriptor);
with FieldsDescriptor do
with AddField('aDate', '', nxtDate, 0, 0, False) do
with AddDefaultValue(TnxConstDefaultValueDescriptor) as TnxConstDefaultValueDescriptor do
AsVariant := '01/21/2015';
CheckValid(False);
end;
except
FreeAndNil(Result);
raise;
end;
end;


The default value is tied to the regional settings and restructure will not do well with this.

Would it be possible to have
AsVariant := EncodeDate(2015,1,21);

This would not interfere with the regional settings on the PC where the restructure is being done.

EM 32 bit 3.12.04

Thank you,
Denis Prince
  #2  
Old 30th April 2015, 02:37 AM
Eivind Bakkestuen [NDD]
 
Posts: n/a
Default Re: EM Code generator and dates with default values

> EM 32 bit 3.12.04

Please try it with the latest v4.

--
Eivind Bakkestuen [NDD]
  #3  
Old 30th April 2015, 02:40 AM
denisprince denisprince is offline
Junior Member
 
Join Date: Aug 2011
Posts: 12
Default EM Code generator and dates with default values

Just downloaded the latest EM 4.0012 trial version and I see that this has been corrected.

Sorry for the inconvenience.

Denis Prince


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Incorrect value in generated source code (pas) for default time values. Rodrigo Gomez [NDX] nexusdb.public.support 6 20th June 2014 03:24 AM
Using EM code generator Sue King nexusdb.public.support 1 30th June 2011 05:19 PM
SQL from Source Code Generator Roberto Nicchi Binaries 0 3rd March 2011 09:13 PM
Code generator Tutorial DanCroghan nexusdb.public.support 2 10th January 2011 02:02 PM
Problem with code generated by EM source code generator Stefan Paege nexusdb.public.support 8 15th December 2010 12:27 AM


All times are GMT +11. The time now is 07:04 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.