unit uPSI_Databases;
{
This file has been generated by UnitParser v0.7, written by M. Knight
and updated by NP. v/d Spek and George Birbilis.
Source Code from Carlo Kok has been used to implement various sections of
UnitParser. Components of ROPS are used in the construction of UnitParser,
code implementing the class wrapper is taken from Carlo Kok's conv utility

}
interface



uses
   SysUtils
  ,Classes
  ,uPSComponent
  ,uPSRuntime
  ,uPSCompiler
  ;

type
(*----------------------------------------------------------------------------*)
  TPSImport_Databases = class(TPSPlugin)
  public
    procedure CompileImport1(CompExec: TPSScript); override;
    procedure ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); override;
  end;


{ compile-time registration functions }
procedure SIRegister_TDBQuery(CL: TPSPascalCompiler);
procedure SIRegister_TFieldList(CL: TPSPascalCompiler);
procedure SIRegister_TFieldNode(CL: TPSPascalCompiler);
procedure SIRegister_TDBConnection(CL: TPSPascalCompiler);
procedure SIRegister_Databases(CL: TPSPascalCompiler);

{ run-time registration functions }
procedure RIRegister_TDBQuery(CL: TPSRuntimeClassImporter);
procedure RIRegister_TFieldList(CL: TPSRuntimeClassImporter);
procedure RIRegister_TFieldNode(CL: TPSRuntimeClassImporter);
procedure RIRegister_TDBConnection(CL: TPSRuntimeClassImporter);
procedure RIRegister_Databases(CL: TPSRuntimeClassImporter);

function PSPluginCreate(): TPSPlugin; stdcall;

implementation


uses
   Databases
  ;


function PSPluginCreate(): TPSPlugin; stdcall;
var
  Import: TPSImport_Databases;
begin
  Import:= TPSImport_Databases.Create(nil);
  Result := Import;
end;

(* === compile-time registration functions === *)
(*----------------------------------------------------------------------------*)
procedure SIRegister_TDBQuery(CL: TPSPascalCompiler);
begin
  //with RegClassS(CL,'TObject', 'TDBQuery') do
  with CL.AddClassN(CL.FindClass('TObject'),'TDBQuery') do
  begin
    RegisterMethod('Constructor Create');
    RegisterMethod('Procedure Open');
    RegisterMethod('Procedure Close');
    RegisterMethod('Procedure Next');
    RegisterMethod('Procedure First');
    RegisterMethod('Procedure Last');
    RegisterMethod('Procedure Previous');
    RegisterMethod('Procedure Append');
    RegisterMethod('Procedure Edit');
    RegisterMethod('Procedure Post');
    RegisterMethod('Procedure ExecSQL');
    RegisterMethod('Function Eof : boolean');
    RegisterMethod('Function FieldByNameAsBoolean( FieldName : string) : Boolean');
    RegisterMethod('Function FieldByNameAsDateTime( FieldName : string) : TDateTime');
    RegisterMethod('Function FieldByNameAsFloat( FieldName : string) : Double');
    RegisterMethod('Function FieldByNameAsInteger( FieldName : string) : Longint');
    RegisterMethod('Function FieldByNameAsString( FieldName : string) : String');
    RegisterProperty('Active', 'boolean', iptrw);
    RegisterProperty('Connection', 'TDBConnection', iptrw);
    RegisterProperty('SQL', 'TStrings', iptr);
    RegisterProperty('Fields', 'TFieldList', iptrw);
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_TFieldList(CL: TPSPascalCompiler);
begin
  //with RegClassS(CL,'TObject', 'TFieldList') do
  with CL.AddClassN(CL.FindClass('TObject'),'TFieldList') do
  begin
    RegisterMethod('Constructor Create( ADataSet : TObject)');
    RegisterMethod('Procedure Add( Field : TFieldNode)');
    RegisterMethod('Procedure CheckFieldName( const FieldName : string)');
    RegisterMethod('Procedure CheckFieldNames( const FieldNames : string)');
    RegisterMethod('Procedure Clear');
    RegisterMethod('Procedure ClearAutomatic');
    RegisterMethod('Function FindField( const FieldName : string) : TFieldNode');
    RegisterMethod('Function FieldByName( const FieldName : string) : TFieldNode');
    RegisterMethod('Function FieldByNumber( FieldNo : Integer) : TFieldNode');
    RegisterMethod('Procedure GetFieldNames( List : TStrings)');
    RegisterMethod('Function IndexOf( Field : TFieldNode) : Integer');
    RegisterMethod('Procedure Remove( Field : TFieldNode)');
    RegisterProperty('Dataset', 'TObject', iptr);
    RegisterProperty('Count', 'Integer', iptr);
    RegisterProperty('Fields', 'TFieldNode Integer', iptrw);
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_TFieldNode(CL: TPSPascalCompiler);
begin
  //with RegClassS(CL,'TObject', 'TFieldNode') do
  with CL.AddClassN(CL.FindClass('TObject'),'TFieldNode') do
  begin
    RegisterMethod('Constructor Create( )');
    RegisterMethod('Procedure Clear');
    RegisterMethod('Procedure FocusControl');
    RegisterProperty('AsBoolean', 'Boolean', iptrw);
    RegisterProperty('AsCurrency', 'Currency', iptrw);
    RegisterProperty('AsDateTime', 'TDateTime', iptrw);
    RegisterProperty('AsSingle', 'Single', iptrw);
    RegisterProperty('AsFloat', 'Double', iptrw);
    RegisterProperty('AsExtended', 'Extended', iptrw);
    RegisterProperty('AsInteger', 'Longint', iptrw);
    RegisterProperty('AsLargeInt', 'LongInt', iptrw);
    RegisterProperty('AsLongWord', 'LongWord', iptrw);
    RegisterProperty('AsString', 'string', iptrw);
    RegisterProperty('AsWideString', 'string', iptrw);
    RegisterProperty('AsAnsiString', 'AnsiString', iptrw);
    RegisterProperty('AsVariant', 'Variant', iptrw);
    RegisterProperty('AttributeSet', 'string', iptrw);
    RegisterProperty('CurValue', 'Variant', iptr);
    RegisterProperty('DataSize', 'Integer', iptr);
    RegisterProperty('DataType', 'string', iptr);
    RegisterProperty('FieldNo', 'Integer', iptr);
    RegisterProperty('FullName', 'string', iptr);
    RegisterProperty('IsIndexField', 'Boolean', iptr);
    RegisterProperty('IsNull', 'Boolean', iptr);
    RegisterProperty('NewValue', 'Variant', iptrw);
    RegisterProperty('OldValue', 'Variant', iptr);
    RegisterProperty('Size', 'Integer', iptrw);
    RegisterProperty('Text', 'string', iptrw);
    RegisterProperty('Value', 'Variant', iptrw);
    RegisterProperty('DisplayLabel', 'string', iptrw);
    RegisterProperty('DisplayWidth', 'Integer', iptrw);
    RegisterProperty('FieldName', 'string', iptrw);
    RegisterProperty('HasConstraints', 'Boolean', iptr);
    RegisterProperty('Index', 'Integer', iptrw);
    RegisterProperty('KeyFields', 'string', iptrw);
    RegisterProperty('Origin', 'string', iptrw);
    RegisterProperty('ReadOnly', 'Boolean', iptrw);
    RegisterProperty('Required', 'Boolean', iptrw);
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_TDBConnection(CL: TPSPascalCompiler);
begin
  //with RegClassS(CL,'TObject', 'TDBConnection') do
  with CL.AddClassN(CL.FindClass('TObject'),'TDBConnection') do
  begin
    RegisterMethod('Constructor Create');
    RegisterMethod('Procedure Open( )');
    RegisterMethod('Procedure Close( )');
    RegisterProperty('ProviderName', 'AnsiString', iptrw);
    RegisterProperty('UserName', 'string', iptrw);
    RegisterProperty('Password', 'string', iptrw);
    RegisterProperty('Server', 'string', iptrw);
    RegisterProperty('Port', 'integer', iptrw);
    RegisterProperty('Database', 'string', iptrw);
    RegisterProperty('Connected', 'boolean', iptrw);
    RegisterProperty('Params', 'TStringList', iptr);
  end;
end;

(*----------------------------------------------------------------------------*)
procedure SIRegister_Databases(CL: TPSPascalCompiler);
begin
  SIRegister_TDBConnection(CL);
  SIRegister_TFieldNode(CL);
  SIRegister_TFieldList(CL);
  SIRegister_TDBQuery(CL);
end;

(* === run-time registration functions === *)
(*----------------------------------------------------------------------------*)
procedure TDBQueryFields_W(Self: TDBQuery; const T: TFieldList);
begin Self.Fields := T; end;

(*----------------------------------------------------------------------------*)
procedure TDBQueryFields_R(Self: TDBQuery; var T: TFieldList);
begin T := Self.Fields; end;

(*----------------------------------------------------------------------------*)
procedure TDBQuerySQL_R(Self: TDBQuery; var T: TStrings);
begin T := Self.SQL; end;

(*----------------------------------------------------------------------------*)
procedure TDBQueryConnection_W(Self: TDBQuery; const T: TDBConnection);
begin Self.Connection := T; end;

(*----------------------------------------------------------------------------*)
procedure TDBQueryConnection_R(Self: TDBQuery; var T: TDBConnection);
begin T := Self.Connection; end;

(*----------------------------------------------------------------------------*)
procedure TDBQueryActive_W(Self: TDBQuery; const T: boolean);
begin Self.Active := T; end;

(*----------------------------------------------------------------------------*)
procedure TDBQueryActive_R(Self: TDBQuery; var T: boolean);
begin T := Self.Active; end;

(*----------------------------------------------------------------------------*)
procedure TFieldListFields_W(Self: TFieldList; const T: TFieldNode; const t1: Integer);
begin Self.Fields[t1] := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldListFields_R(Self: TFieldList; var T: TFieldNode; const t1: Integer);
begin T := Self.Fields[t1]; end;

(*----------------------------------------------------------------------------*)
procedure TFieldListCount_R(Self: TFieldList; var T: Integer);
begin T := Self.Count; end;

(*----------------------------------------------------------------------------*)
procedure TFieldListDataset_R(Self: TFieldList; var T: TObject);
begin T := Self.Dataset; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeRequired_W(Self: TFieldNode; const T: Boolean);
begin Self.Required := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeRequired_R(Self: TFieldNode; var T: Boolean);
begin T := Self.Required; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeReadOnly_W(Self: TFieldNode; const T: Boolean);
begin Self.ReadOnly := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeReadOnly_R(Self: TFieldNode; var T: Boolean);
begin T := Self.ReadOnly; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeOrigin_W(Self: TFieldNode; const T: string);
begin Self.Origin := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeOrigin_R(Self: TFieldNode; var T: string);
begin T := Self.Origin; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeKeyFields_W(Self: TFieldNode; const T: string);
begin Self.KeyFields := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeKeyFields_R(Self: TFieldNode; var T: string);
begin T := Self.KeyFields; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeIndex_W(Self: TFieldNode; const T: Integer);
begin Self.Index := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeIndex_R(Self: TFieldNode; var T: Integer);
begin T := Self.Index; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeHasConstraints_R(Self: TFieldNode; var T: Boolean);
begin T := Self.HasConstraints; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeFieldName_W(Self: TFieldNode; const T: string);
begin Self.FieldName := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeFieldName_R(Self: TFieldNode; var T: string);
begin T := Self.FieldName; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeDisplayWidth_W(Self: TFieldNode; const T: Integer);
begin Self.DisplayWidth := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeDisplayWidth_R(Self: TFieldNode; var T: Integer);
begin T := Self.DisplayWidth; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeDisplayLabel_W(Self: TFieldNode; const T: string);
begin Self.DisplayLabel := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeDisplayLabel_R(Self: TFieldNode; var T: string);
begin T := Self.DisplayLabel; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeValue_W(Self: TFieldNode; const T: Variant);
begin Self.Value := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeValue_R(Self: TFieldNode; var T: Variant);
begin T := Self.Value; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeText_W(Self: TFieldNode; const T: string);
begin Self.Text := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeText_R(Self: TFieldNode; var T: string);
begin T := Self.Text; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeSize_W(Self: TFieldNode; const T: Integer);
begin Self.Size := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeSize_R(Self: TFieldNode; var T: Integer);
begin T := Self.Size; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeOldValue_R(Self: TFieldNode; var T: Variant);
begin T := Self.OldValue; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeNewValue_W(Self: TFieldNode; const T: Variant);
begin Self.NewValue := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeNewValue_R(Self: TFieldNode; var T: Variant);
begin T := Self.NewValue; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeIsNull_R(Self: TFieldNode; var T: Boolean);
begin T := Self.IsNull; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeIsIndexField_R(Self: TFieldNode; var T: Boolean);
begin T := Self.IsIndexField; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeFullName_R(Self: TFieldNode; var T: string);
begin T := Self.FullName; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeFieldNo_R(Self: TFieldNode; var T: Integer);
begin T := Self.FieldNo; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeDataType_R(Self: TFieldNode; var T: string);
begin T := Self.DataType; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeDataSize_R(Self: TFieldNode; var T: Integer);
begin T := Self.DataSize; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeCurValue_R(Self: TFieldNode; var T: Variant);
begin T := Self.CurValue; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAttributeSet_W(Self: TFieldNode; const T: string);
begin Self.AttributeSet := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAttributeSet_R(Self: TFieldNode; var T: string);
begin T := Self.AttributeSet; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsVariant_W(Self: TFieldNode; const T: Variant);
begin Self.AsVariant := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsVariant_R(Self: TFieldNode; var T: Variant);
begin T := Self.AsVariant; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsAnsiString_W(Self: TFieldNode; const T: AnsiString);
begin Self.AsAnsiString := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsAnsiString_R(Self: TFieldNode; var T: AnsiString);
begin T := Self.AsAnsiString; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsWideString_W(Self: TFieldNode; const T: string);
begin Self.AsWideString := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsWideString_R(Self: TFieldNode; var T: string);
begin T := Self.AsWideString; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsString_W(Self: TFieldNode; const T: string);
begin Self.AsString := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsString_R(Self: TFieldNode; var T: string);
begin T := Self.AsString; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsLongWord_W(Self: TFieldNode; const T: LongWord);
begin Self.AsLongWord := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsLongWord_R(Self: TFieldNode; var T: LongWord);
begin T := Self.AsLongWord; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsLargeInt_W(Self: TFieldNode; const T: LongInt);
begin Self.AsLargeInt := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsLargeInt_R(Self: TFieldNode; var T: LongInt);
begin T := Self.AsLargeInt; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsInteger_W(Self: TFieldNode; const T: Longint);
begin Self.AsInteger := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsInteger_R(Self: TFieldNode; var T: Longint);
begin T := Self.AsInteger; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsExtended_W(Self: TFieldNode; const T: Extended);
begin Self.AsExtended := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsExtended_R(Self: TFieldNode; var T: Extended);
begin T := Self.AsExtended; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsFloat_W(Self: TFieldNode; const T: Double);
begin Self.AsFloat := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsFloat_R(Self: TFieldNode; var T: Double);
begin T := Self.AsFloat; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsSingle_W(Self: TFieldNode; const T: Single);
begin Self.AsSingle := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsSingle_R(Self: TFieldNode; var T: Single);
begin T := Self.AsSingle; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsDateTime_W(Self: TFieldNode; const T: TDateTime);
begin Self.AsDateTime := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsDateTime_R(Self: TFieldNode; var T: TDateTime);
begin T := Self.AsDateTime; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsCurrency_W(Self: TFieldNode; const T: Currency);
begin Self.AsCurrency := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsCurrency_R(Self: TFieldNode; var T: Currency);
begin T := Self.AsCurrency; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsBoolean_W(Self: TFieldNode; const T: Boolean);
begin Self.AsBoolean := T; end;

(*----------------------------------------------------------------------------*)
procedure TFieldNodeAsBoolean_R(Self: TFieldNode; var T: Boolean);
begin T := Self.AsBoolean; end;

(*----------------------------------------------------------------------------*)
procedure TDBConnectionParams_R(Self: TDBConnection; var T: TStringList);
begin T := Self.Params; end;

(*----------------------------------------------------------------------------*)
procedure TDBConnectionConnected_W(Self: TDBConnection; const T: boolean);
begin Self.Connected := T; end;

(*----------------------------------------------------------------------------*)
procedure TDBConnectionConnected_R(Self: TDBConnection; var T: boolean);
begin T := Self.Connected; end;

(*----------------------------------------------------------------------------*)
procedure TDBConnectionDatabase_W(Self: TDBConnection; const T: string);
begin Self.Database := T; end;

(*----------------------------------------------------------------------------*)
procedure TDBConnectionDatabase_R(Self: TDBConnection; var T: string);
begin T := Self.Database; end;

(*----------------------------------------------------------------------------*)
procedure TDBConnectionPort_W(Self: TDBConnection; const T: integer);
begin Self.Port := T; end;

(*----------------------------------------------------------------------------*)
procedure TDBConnectionPort_R(Self: TDBConnection; var T: integer);
begin T := Self.Port; end;

(*----------------------------------------------------------------------------*)
procedure TDBConnectionServer_W(Self: TDBConnection; const T: string);
begin Self.Server := T; end;

(*----------------------------------------------------------------------------*)
procedure TDBConnectionServer_R(Self: TDBConnection; var T: string);
begin T := Self.Server; end;

(*----------------------------------------------------------------------------*)
procedure TDBConnectionPassword_W(Self: TDBConnection; const T: string);
begin Self.Password := T; end;

(*----------------------------------------------------------------------------*)
procedure TDBConnectionPassword_R(Self: TDBConnection; var T: string);
begin T := Self.Password; end;

(*----------------------------------------------------------------------------*)
procedure TDBConnectionUserName_W(Self: TDBConnection; const T: string);
begin Self.UserName := T; end;

(*----------------------------------------------------------------------------*)
procedure TDBConnectionUserName_R(Self: TDBConnection; var T: string);
begin T := Self.UserName; end;

(*----------------------------------------------------------------------------*)
procedure TDBConnectionProviderName_W(Self: TDBConnection; const T: AnsiString);
begin Self.ProviderName := T; end;

(*----------------------------------------------------------------------------*)
procedure TDBConnectionProviderName_R(Self: TDBConnection; var T: AnsiString);
begin T := Self.ProviderName; end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_TDBQuery(CL: TPSRuntimeClassImporter);
begin
  with CL.Add(TDBQuery) do
  begin
    RegisterConstructor(@TDBQuery.Create, 'Create');
    RegisterMethod(@TDBQuery.Open, 'Open');
    RegisterMethod(@TDBQuery.Close, 'Close');
    RegisterMethod(@TDBQuery.Next, 'Next');
    RegisterMethod(@TDBQuery.First, 'First');
    RegisterMethod(@TDBQuery.Last, 'Last');
    RegisterMethod(@TDBQuery.Previous, 'Previous');
    RegisterMethod(@TDBQuery.Append, 'Append');
    RegisterMethod(@TDBQuery.Edit, 'Edit');
    RegisterMethod(@TDBQuery.Post, 'Post');
    RegisterMethod(@TDBQuery.ExecSQL, 'ExecSQL');
    RegisterMethod(@TDBQuery.Eof, 'Eof');
    RegisterMethod(@TDBQuery.FieldByNameAsBoolean, 'FieldByNameAsBoolean');
    RegisterMethod(@TDBQuery.FieldByNameAsDateTime, 'FieldByNameAsDateTime');
    RegisterMethod(@TDBQuery.FieldByNameAsFloat, 'FieldByNameAsFloat');
    RegisterMethod(@TDBQuery.FieldByNameAsInteger, 'FieldByNameAsInteger');
    RegisterMethod(@TDBQuery.FieldByNameAsString, 'FieldByNameAsString');
    RegisterPropertyHelper(@TDBQueryActive_R,@TDBQueryActive_W,'Active');
    RegisterPropertyHelper(@TDBQueryConnection_R,@TDBQueryConnection_W,'Connection');
    RegisterPropertyHelper(@TDBQuerySQL_R,nil,'SQL');
    RegisterPropertyHelper(@TDBQueryFields_R,@TDBQueryFields_W,'Fields');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_TFieldList(CL: TPSRuntimeClassImporter);
begin
  with CL.Add(TFieldList) do
  begin
    RegisterConstructor(@TFieldList.Create, 'Create');
    RegisterMethod(@TFieldList.Add, 'Add');
    RegisterMethod(@TFieldList.CheckFieldName, 'CheckFieldName');
    RegisterMethod(@TFieldList.CheckFieldNames, 'CheckFieldNames');
    RegisterMethod(@TFieldList.Clear, 'Clear');
    RegisterMethod(@TFieldList.ClearAutomatic, 'ClearAutomatic');
    RegisterMethod(@TFieldList.FindField, 'FindField');
    RegisterMethod(@TFieldList.FieldByName, 'FieldByName');
    RegisterMethod(@TFieldList.FieldByNumber, 'FieldByNumber');
    RegisterMethod(@TFieldList.GetFieldNames, 'GetFieldNames');
    RegisterMethod(@TFieldList.IndexOf, 'IndexOf');
    RegisterMethod(@TFieldList.Remove, 'Remove');
    RegisterPropertyHelper(@TFieldListDataset_R,nil,'Dataset');
    RegisterPropertyHelper(@TFieldListCount_R,nil,'Count');
    RegisterPropertyHelper(@TFieldListFields_R,@TFieldListFields_W,'Fields');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_TFieldNode(CL: TPSRuntimeClassImporter);
begin
  with CL.Add(TFieldNode) do
  begin
    RegisterConstructor(@TFieldNode.Create, 'Create');
    RegisterMethod(@TFieldNode.Clear, 'Clear');
    RegisterMethod(@TFieldNode.FocusControl, 'FocusControl');
    RegisterPropertyHelper(@TFieldNodeAsBoolean_R,@TFieldNodeAsBoolean_W,'AsBoolean');
    RegisterPropertyHelper(@TFieldNodeAsCurrency_R,@TFieldNodeAsCurrency_W,'AsCurrency');
    RegisterPropertyHelper(@TFieldNodeAsDateTime_R,@TFieldNodeAsDateTime_W,'AsDateTime');
    RegisterPropertyHelper(@TFieldNodeAsSingle_R,@TFieldNodeAsSingle_W,'AsSingle');
    RegisterPropertyHelper(@TFieldNodeAsFloat_R,@TFieldNodeAsFloat_W,'AsFloat');
    RegisterPropertyHelper(@TFieldNodeAsExtended_R,@TFieldNodeAsExtended_W,'AsExtended');
    RegisterPropertyHelper(@TFieldNodeAsInteger_R,@TFieldNodeAsInteger_W,'AsInteger');
    RegisterPropertyHelper(@TFieldNodeAsLargeInt_R,@TFieldNodeAsLargeInt_W,'AsLargeInt');
    RegisterPropertyHelper(@TFieldNodeAsLongWord_R,@TFieldNodeAsLongWord_W,'AsLongWord');
    RegisterPropertyHelper(@TFieldNodeAsString_R,@TFieldNodeAsString_W,'AsString');
    RegisterPropertyHelper(@TFieldNodeAsWideString_R,@TFieldNodeAsWideString_W,'AsWideString');
    RegisterPropertyHelper(@TFieldNodeAsAnsiString_R,@TFieldNodeAsAnsiString_W,'AsAnsiString');
    RegisterPropertyHelper(@TFieldNodeAsVariant_R,@TFieldNodeAsVariant_W,'AsVariant');
    RegisterPropertyHelper(@TFieldNodeAttributeSet_R,@TFieldNodeAttributeSet_W,'AttributeSet');
    RegisterPropertyHelper(@TFieldNodeCurValue_R,nil,'CurValue');
    RegisterPropertyHelper(@TFieldNodeDataSize_R,nil,'DataSize');
    RegisterPropertyHelper(@TFieldNodeDataType_R,nil,'DataType');
    RegisterPropertyHelper(@TFieldNodeFieldNo_R,nil,'FieldNo');
    RegisterPropertyHelper(@TFieldNodeFullName_R,nil,'FullName');
    RegisterPropertyHelper(@TFieldNodeIsIndexField_R,nil,'IsIndexField');
    RegisterPropertyHelper(@TFieldNodeIsNull_R,nil,'IsNull');
    RegisterPropertyHelper(@TFieldNodeNewValue_R,@TFieldNodeNewValue_W,'NewValue');
    RegisterPropertyHelper(@TFieldNodeOldValue_R,nil,'OldValue');
    RegisterPropertyHelper(@TFieldNodeSize_R,@TFieldNodeSize_W,'Size');
    RegisterPropertyHelper(@TFieldNodeText_R,@TFieldNodeText_W,'Text');
    RegisterPropertyHelper(@TFieldNodeValue_R,@TFieldNodeValue_W,'Value');
    RegisterPropertyHelper(@TFieldNodeDisplayLabel_R,@TFieldNodeDisplayLabel_W,'DisplayLabel');
    RegisterPropertyHelper(@TFieldNodeDisplayWidth_R,@TFieldNodeDisplayWidth_W,'DisplayWidth');
    RegisterPropertyHelper(@TFieldNodeFieldName_R,@TFieldNodeFieldName_W,'FieldName');
    RegisterPropertyHelper(@TFieldNodeHasConstraints_R,nil,'HasConstraints');
    RegisterPropertyHelper(@TFieldNodeIndex_R,@TFieldNodeIndex_W,'Index');
    RegisterPropertyHelper(@TFieldNodeKeyFields_R,@TFieldNodeKeyFields_W,'KeyFields');
    RegisterPropertyHelper(@TFieldNodeOrigin_R,@TFieldNodeOrigin_W,'Origin');
    RegisterPropertyHelper(@TFieldNodeReadOnly_R,@TFieldNodeReadOnly_W,'ReadOnly');
    RegisterPropertyHelper(@TFieldNodeRequired_R,@TFieldNodeRequired_W,'Required');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_TDBConnection(CL: TPSRuntimeClassImporter);
begin
  with CL.Add(TDBConnection) do
  begin
    RegisterConstructor(@TDBConnection.Create, 'Create');
    RegisterMethod(@TDBConnection.Open, 'Open');
    RegisterMethod(@TDBConnection.Close, 'Close');
    RegisterPropertyHelper(@TDBConnectionProviderName_R,@TDBConnectionProviderName_W,'ProviderName');
    RegisterPropertyHelper(@TDBConnectionUserName_R,@TDBConnectionUserName_W,'UserName');
    RegisterPropertyHelper(@TDBConnectionPassword_R,@TDBConnectionPassword_W,'Password');
    RegisterPropertyHelper(@TDBConnectionServer_R,@TDBConnectionServer_W,'Server');
    RegisterPropertyHelper(@TDBConnectionPort_R,@TDBConnectionPort_W,'Port');
    RegisterPropertyHelper(@TDBConnectionDatabase_R,@TDBConnectionDatabase_W,'Database');
    RegisterPropertyHelper(@TDBConnectionConnected_R,@TDBConnectionConnected_W,'Connected');
    RegisterPropertyHelper(@TDBConnectionParams_R,nil,'Params');
  end;
end;

(*----------------------------------------------------------------------------*)
procedure RIRegister_Databases(CL: TPSRuntimeClassImporter);
begin
  RIRegister_TDBConnection(CL);
  RIRegister_TFieldNode(CL);
  RIRegister_TFieldList(CL);
  RIRegister_TDBQuery(CL);
end;



{ TPSImport_Databases }
(*----------------------------------------------------------------------------*)
procedure TPSImport_Databases.CompileImport1(CompExec: TPSScript);
begin
  SIRegister_Databases(CompExec.Comp);
end;
(*----------------------------------------------------------------------------*)
procedure TPSImport_Databases.ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter);
begin
  RIRegister_Databases(ri);
end;
(*----------------------------------------------------------------------------*)


end.
