Changeset 14 for trunk/UCore.pas


Ignore:
Timestamp:
Mar 22, 2018, 7:59:13 PM (7 years ago)
Author:
chronos
Message:
  • Added: Support for item references.
  • Added: Data and Time value types.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r13 r14  
    6868  STypeTime = 'Time';
    6969  STypeDateTime = 'Date and time';
     70  STypeReference = 'Reference';
    7071
    7172{ TCore }
     
    109110begin
    110111  for I := 0 to DataTypes.Count - 1 do begin
    111     TDataType(DataTypes[I]).Name := CoolTranslator1.TranslateText(TDataType(DataTypes[I]).Name, TDataType(DataTypes[I]).Name);
     112    TDataType(DataTypes[I]).Title := CoolTranslator1.TranslateText(TDataType(DataTypes[I]).Title, TDataType(DataTypes[I]).Title);
    112113  end;
    113114end;
     
    130131
    131132  NewEngine := Engines.RegisterEngine('MySQL', TDatabaseMySQL);
    132   NewEngine.UseTypes(DataTypes, [ftString, ftInteger, ftDateTime, ftBoolean, ftFloat]);
     133  NewEngine.UseTypes(DataTypes, [ftString, ftInteger, ftDateTime, ftBoolean, ftFloat,
     134    ftReference]);
    133135
    134136  NewEngine := Engines.RegisterEngine('SQLite', TDatabaseSQLite);
     
    140142  DataTypes.Clear;
    141143  with DataTypes do begin
    142     RegisterType(1, STypeString, ftString, TFieldString);
    143     RegisterType(2, STypeInteger, ftInteger, TFieldInteger);
    144     RegisterType(3, STypeDateTime, ftDateTime, TFieldDateTime);
    145     RegisterType(4, STypeBoolean, ftBoolean, TFieldBoolean);
    146     RegisterType(5, STypeFloat, ftFloat, TFieldFloat);
    147     RegisterType(6, STypeMapPosition, ftMapPosition, TFieldMapPosition);
    148     RegisterType(7, STypeDate, ftDate, TFieldDate);
    149     RegisterType(8, STypeTime, ftTime, TFieldTime);
    150     RegisterType(9, STypeImage, ftImage, TFieldImage);
     144    RegisterType(1, 'String', STypeString, ftString, TFieldString);
     145    RegisterType(2, 'Integer', STypeInteger, ftInteger, TFieldInteger);
     146    RegisterType(3, 'DateTime', STypeDateTime, ftDateTime, TFieldDateTime);
     147    RegisterType(4, 'Boolean', STypeBoolean, ftBoolean, TFieldBoolean);
     148    RegisterType(5, 'Float', STypeFloat, ftFloat, TFieldFloat);
     149    RegisterType(6, 'MapPosition', STypeMapPosition, ftMapPosition, TFieldMapPosition);
     150    RegisterType(7, 'Date', STypeDate, ftDate, TFieldDate);
     151    RegisterType(8, 'Time', STypeTime, ftTime, TFieldTime);
     152    RegisterType(9, 'Image', STypeImage, ftImage, TFieldImage);
     153    RegisterType(10, 'Reference', STypeReference, ftReference, TFieldReference);
    151154  end;
    152155end;
     
    174177  Engine: TDatabaseEngine;
    175178begin
     179  XMLConfig1.FileName := 'Config.xml';
    176180  Databases.Count := XMLConfig1.GetValue('Database/Count', 0);
    177181  for I := 0 to Databases.Count - 1 do begin
Note: See TracChangeset for help on using the changeset viewer.