ROPS (Rem Object Pascal Script) - встраиваемый интерпретатор языка Pascal. Плагин PSImport_DB
Плагин добавляет в среду интерпретатора следующие данные:
Типы (список TPSPascalCompiler.FTypes):
- TFieldType = Enum;
- TDataSetState = Enum;
- TLocateOption = Enum;
- TLocateOptions = Set;
- TUpdateStatus = Enum;
- TUpdateStatusSet = Set;
- TParamType = Byte;
- TDataSet = Class;
- TField = Class;
- TFieldDefs = Class;
- TIndexDefs = Class;
- TObjectField = Class;
- TDataLink = Class;
- TDataSource = Class;
- TParam = Class;
- TNamedItem = Class;
- TDefUpdateMethod = ProcPtr;
- TDefCollection = Class;
- TFieldAttributes = Byte;
- TFieldDef = Class;
- TIndexOptions = Byte;
- TIndexDef = Class;
- TFlatList = Class;
- TFieldDefList = Class;
- TFieldList = Class;
- TFieldKinds = Byte;
- TFields = Class;
- TProviderFlags = Byte;
- TFieldNotifyEvent = ProcPtr;
- TFieldGetTextEvent = ProcPtr;
- TFieldSetTextEvent = ProcPtr;
- TAutoRefreshFlag = Enum;
- TLookupList = Class;
- TStringField = Class;
- TWideStringField = Class;
- TNumericField = Class;
- TIntegerField = Class;
- TSmallintField = Class;
- LargeInt = Int64;
- TLargeintField = Class;
- TWordField = Class;
- TAutoIncField = Class;
- TFloatField = Class;
- TCurrencyField = Class;
- TBooleanField = Class;
- TDateTimeField = Class;
- TDateField = Class;
- TTimeField = Class;
- TBinaryField = Class;
- TBytesField = Class;
- TVarBytesField = Class;
- TBCDField = Class;
- TFMTBCDField = Class;
- TBlobType = Byte;
- TBlobField = Class;
- TMemoField = Class;
- TGraphicField = Class;
- TADTField = Class;
- TArrayField = Class;
- TDataSetField = Class;
- TReferenceField = Class;
- TVariantField = Class;
- TGuidField = Class;
- TBlobData = string;
- TParams = Class;
- TDataAction = Enum;
- TBlobStreamMode = Enum;
- TDataOperation = ProcPtr;
- TDataSetNotifyEvent = ProcPtr;
- TDataSetErrorEvent = ProcPtr;
- TFilterRecordEvent = ProcPtr;
- !OPENARRAYOFCONST = Array of ___Pointer;
Константы (список TPSPascalCompiler.FConstants):
- ftUnknown: TFieldType = 0;
- ftString: TFieldType = 1;
- ftSmallint: TFieldType = 2;
- ftInteger: TFieldType = 3;
- ftWord: TFieldType = 4;
- ftBoolean: TFieldType = 5;
- ftFloat: TFieldType = 6;
- ftCurrency: TFieldType = 7;
- ftBCD: TFieldType = 8;
- ftDate: TFieldType = 9;
- ftTime: TFieldType = 10;
- ftDateTime: TFieldType = 11;
- ftBytes: TFieldType = 12;
- ftVarBytes: TFieldType = 13;
- ftAutoInc: TFieldType = 14;
- ftBlob: TFieldType = 15;
- ftMemo: TFieldType = 16;
- ftGraphic: TFieldType = 17;
- ftFmtMemo: TFieldType = 18;
- ftParadoxOle: TFieldType = 19;
- ftDBaseOle: TFieldType = 20;
- ftTypedBinary: TFieldType = 21;
- ftCursor: TFieldType = 22;
- ftFixedChar: TFieldType = 23;
- ftWideString: TFieldType = 24;
- ftLargeint: TFieldType = 25;
- ftADT: TFieldType = 26;
- ftArray: TFieldType = 27;
- ftReference: TFieldType = 28;
- ftDataSet: TFieldType = 29;
- ftOraBlob: TFieldType = 30;
- ftOraClob: TFieldType = 31;
- ftVariant: TFieldType = 32;
- ftInterface: TFieldType = 33;
- ftIDispatch: TFieldType = 34;
- ftGuid: TFieldType = 35;
- ftTimeStamp: TFieldType = 36;
- ftFMTBcd: TFieldType = 37;
- dsInactive: TDataSetState = 0;
- dsBrowse: TDataSetState = 1;
- dsEdit: TDataSetState = 2;
- dsInsert: TDataSetState = 3;
- dsSetKey: TDataSetState = 4;
- dsCalcFields: TDataSetState = 5;
- dsFilter: TDataSetState = 6;
- dsNewValue: TDataSetState = 7;
- dsOldValue: TDataSetState = 8;
- dsCurValue: TDataSetState = 9;
- dsBlockRead: TDataSetState = 10;
- dsInternalCalc: TDataSetState = 11;
- dsOpening: TDataSetState = 12;
- loCaseInsensitive: TLocateOption = 0;
- loPartialKey: TLocateOption = 1;
- usUnmodified: TUpdateStatus = 0;
- usModified: TUpdateStatus = 1;
- usInserted: TUpdateStatus = 2;
- usDeleted: TUpdateStatus = 3;
- faHiddenCol: LongInt = 1 (0x1);
- faReadOnly: LongInt = 2 (0x2);
- faRequired: LongInt = 4 (0x4);
- faLink: LongInt = 8 (0x8);
- faUnNamed: LongInt = 16 (0x10);
- faFixed: LongInt = 32 (0x20);
- ixPrimary: LongInt = 1 (0x1);
- ixUnique: LongInt = 2 (0x2);
- ixDescending: LongInt = 4 (0x4);
- ixCaseInsensitive: LongInt = 8 (0x8);
- ixExpression: LongInt = 16 (0x10);
- ixNonMaintained: LongInt = 32 (0x20);
- fkData: LongInt = 1 (0x1);
- fkCalculated: LongInt = 2 (0x2);
- fkLookup: LongInt = 4 (0x4);
- fkInternalCalc: LongInt = 8 (0x8);
- fkAggregate: LongInt = 16 (0x10);
- pfInUpdate: LongInt = 1 (0x1);
- pfInWhere: LongInt = 2 (0x2);
- pfInKey: LongInt = 4 (0x4);
- pfHidden: LongInt = 8 (0x8);
- arNone: TAutoRefreshFlag = 0;
- arAutoInc: TAutoRefreshFlag = 1;
- arDefault: TAutoRefreshFlag = 2;
- ptUnknown: LongInt = 1 (0x1);
- ptInput: LongInt = 2 (0x2);
- ptOutput: LongInt = 4 (0x4);
- ptInputOutput: LongInt = 8 (0x8);
- ptResult: LongInt = 16 (0x10);
- daFail: TDataAction = 0;
- daAbort: TDataAction = 1;
- daRetry: TDataAction = 2;
- bmRead: TBlobStreamMode = 0;
- bmWrite: TBlobStreamMode = 1;
- bmReadWrite: TBlobStreamMode = 2;
Классы PSImport_DB (список TPSPascalCompiler.FClasses):
- TDataSet = class(TComponent)
function ActiveBuffer: PChar;
procedure Append;
procedure AppendRecord(Values: !OPENARRAYOFCONST);
procedure Cancel;
procedure CheckBrowseMode;
procedure ClearFields;
procedure Close;
function ControlsDisabled: Boolean;
procedure CursorPosChanged;
procedure Delete;
procedure DisableControls;
procedure Edit;
procedure EnableControls;
function FieldByName(FieldName: string): TField;
function FindField(FieldName: string): TField;
function FindFirst: Boolean;
function FindLast: Boolean;
function FindNext: Boolean;
function FindPrior: Boolean;
procedure First;
function GetCurrentRecord(Buffer: PChar): Boolean;
procedure Insert;
procedure InsertRecord(Values: !OPENARRAYOFCONST);
function IsEmpty: Boolean;
function IsLinkedTo(DataSource: TDataSource): Boolean;
function IsSequenced: Boolean;
procedure Last;
function Locate(KeyFields: string; KeyValues: Variant; Options: TLocateOptions): Boolean;
function Lookup(KeyFields: string; KeyValues: Variant; ResultFields: string): Variant;
function MoveBy(Distance: LongInt): LongInt;
procedure Next;
procedure Open;
procedure Post;
procedure Prior;
procedure Refresh;
procedure SetFields(Values: !OPENARRAYOFCONST);
function Translate(Src: PChar; Dest: PChar; ToOem: Boolean): LongInt;
procedure UpdateCursorPos;
procedure UpdateRecord;
function UpdateStatus: TUpdateStatus;
property AggFields: TFields read Get;
property BOF: Boolean read Get;
property CanModify: Boolean read Get;
property DataSetField: TDataSetField read Get write Set;
property DataSource: TDataSource read Get;
property DefaultFields: Boolean read Get;
property EOF: Boolean read Get;
property BlockReadSize: LongInt read Get write Set;
property FieldCount: LongInt read Get;
property FieldDefs: TFieldDefs read Get write Set;
property FieldDefList: TFieldDefList read Get;
property Fields: TFields read Get;
property FieldList: TFieldList read Get;
property FieldValues(param1: string): Variant read Get write Set;
property Found: Boolean read Get;
property IsUnidirectional: Boolean read Get;
property Modified: Boolean read Get;
property ObjectView: Boolean read Get write Set;
property RecordCount: LongInt read Get;
property RecNo: LongInt read Get write Set;
property RecordSize: Word read Get;
property SparseArrays: Boolean read Get write Set;
property State: TDataSetState read Get;
property Filter: string read Get write Set;
property Filtered: Boolean read Get write Set;
property Active: Boolean read Get write Set;
property AutoCalcFields: Boolean read Get write Set;
property BeforeOpen: TDataSetNotifyEvent read Get write Set;
property AfterOpen: TDataSetNotifyEvent read Get write Set;
property BeforeClose: TDataSetNotifyEvent read Get write Set;
property AfterClose: TDataSetNotifyEvent read Get write Set;
property BeforeInsert: TDataSetNotifyEvent read Get write Set;
property AfterInsert: TDataSetNotifyEvent read Get write Set;
property BeforeEdit: TDataSetNotifyEvent read Get write Set;
property AfterEdit: TDataSetNotifyEvent read Get write Set;
property BeforePost: TDataSetNotifyEvent read Get write Set;
property AfterPost: TDataSetNotifyEvent read Get write Set;
property BeforeCancel: TDataSetNotifyEvent read Get write Set;
property AfterCancel: TDataSetNotifyEvent read Get write Set;
property BeforeDelete: TDataSetNotifyEvent read Get write Set;
property AfterDelete: TDataSetNotifyEvent read Get write Set;
property BeforeScroll: TDataSetNotifyEvent read Get write Set;
property AfterScroll: TDataSetNotifyEvent read Get write Set;
property BeforeRefresh: TDataSetNotifyEvent read Get write Set;
property AfterRefresh: TDataSetNotifyEvent read Get write Set;
property OnCalcFields: TDataSetNotifyEvent read Get write Set;
property OnDeleteError: TDataSetErrorEvent read Get write Set;
property OnEditError: TDataSetErrorEvent read Get write Set;
property OnFilterRecord: TFilterRecordEvent read Get write Set;
property OnNewRecord: TDataSetNotifyEvent read Get write Set;
property OnPostError: TDataSetErrorEvent read Get write Set;
end;
- TField = class(TComponent)
procedure Clear;
procedure FocusControl;
function IsValidChar(InputChar: Char): Boolean;
procedure RefreshLookupList;
procedure SetFieldType(Value: TFieldType);
property AsBoolean: Boolean read Get write Set;
property AsCurrency: Currency read Get write Set;
property AsFloat: Double read Get write Set;
property AsInteger: LongInt read Get write Set;
property AsString: string read Get write Set;
property AsVariant: Variant read Get write Set;
property AttributeSet: string read Get write Set;
property Calculated: Boolean read Get write Set;
property CanModify: Boolean read Get;
property CurValue: Variant read Get;
property Dataset: TDataSet read Get write Set;
property DataSize: LongInt read Get;
property DataType: TFieldType read Get;
property DisplayName: string read Get;
property DisplayText: string read Get;
property EditMask: string read Get write Set;
property EditMaskPtr: string read Get;
property FieldNo: LongInt read Get;
property FullName: string read Get;
property IsIndexField: Boolean read Get;
property IsNull: Boolean read Get;
property Lookup: Boolean read Get write Set;
property LookupList: TLookupList read Get;
property NewValue: Variant read Get write Set;
property Offset: LongInt read Get;
property OldValue: Variant read Get;
property ParentField: TObjectField read Get write Set;
property Size: LongInt read Get write Set;
property Text: string read Get write Set;
property Value: Variant read Get write Set;
property AutoGenerateValue: TAutoRefreshFlag read Get write Set;
property CustomConstraint: string read Get write Set;
property ConstraintErrorMessage: string read Get write Set;
property DefaultExpression: string read Get write Set;
property DisplayLabel: string read Get write Set;
property DisplayWidth: LongInt read Get write Set;
property FieldName: string read Get write Set;
property HasConstraints: Boolean read Get;
property Index: LongInt read Get write Set;
property ImportedConstraint: string read Get write Set;
property LookupDataSet: TDataSet read Get write Set;
property LookupKeyFields: string read Get write Set;
property LookupResultField: string read Get write Set;
property KeyFields: string read Get write Set;
property LookupCache: Boolean read Get write Set;
property Origin: string read Get write Set;
property ProviderFlags: Byte read Get write Set;
property ReadOnly: Boolean read Get write Set;
property Required: Boolean read Get write Set;
property Visible: Boolean read Get write Set;
property OnChange: TFieldNotifyEvent read Get write Set;
property OnGetText: TFieldGetTextEvent read Get write Set;
property OnSetText: TFieldSetTextEvent read Get write Set;
property OnValidate: TFieldNotifyEvent read Get write Set;
end;
- TFieldDefs = class(TDefCollection)
constructor Create(AOwner: TPersistent): TFieldDefs;
function AddFieldDef: TFieldDef;
function Find(Name: string): TFieldDef;
procedure Update;
procedure Add(Name: string; DataType: TFieldType; Size: LongInt; Required: Boolean);
property HiddenFields: Boolean read Get write Set;
property Items(param1: LongInt): TFieldDef read Get write Set;
property ParentDef: TFieldDef read Get;
end;
- TIndexDefs = class(TDefCollection)
constructor Create(ADataSet: TDataSet): TIndexDefs;
function AddIndexDef: TIndexDef;
function Find(Name: string): TIndexDef;
procedure Update;
function FindIndexForFields(Fields: string): TIndexDef;
function GetIndexForFields(Fields: string; CaseInsensitive: Boolean): TIndexDef;
procedure Add(Name: string; Fields: string; Options: Byte);
property Items(param1: LongInt): TIndexDef read Get write Set;
end;
- TObjectField = class(TField)
property FieldCount: LongInt read Get;
property Fields: TFields read Get;
property FieldValues(param1: LongInt): Variant read Get write Set;
property UnNamed: Boolean read Get;
property ObjectType: string read Get write Set;
end;
- TDataLink = class(TComponent)
end;
- TDataSource = class(TComponent)
end;
- TParam = class(TCollectionItem)
procedure AssignField(Field: TField);
procedure AssignFieldValue(Field: TField; Value: Variant);
procedure Clear;
function GetDataSize: LongInt;
procedure LoadFromFile(FileName: string; BlobType: Byte);
property AsBCD: Currency read Get write Set;
property AsBlob: string read Get write Set;
property AsBoolean: Boolean read Get write Set;
property AsCurrency: Currency read Get write Set;
property AsFloat: Double read Get write Set;
property AsInteger: LongInt read Get write Set;
property AsSmallInt: LongInt read Get write Set;
property AsMemo: string read Get write Set;
property AsString: string read Get write Set;
property AsWord: LongInt read Get write Set;
property Bound: Boolean read Get write Set;
property IsNull: Boolean read Get;
property NativeStr: string read Get write Set;
property Text: string read Get write Set;
property DataType: TFieldType read Get write Set;
property Precision: LongInt read Get write Set;
property NumericScale: LongInt read Get write Set;
property Size: LongInt read Get write Set;
property Name: string read Get write Set;
property ParamType: Byte read Get write Set;
property Value: Variant read Get write Set;
end;
- TNamedItem = class(TCollectionItem)
property Name: string read Get write Set;
end;
- TDefCollection = class(TOwnedCollection)
function Find(AName: string): TNamedItem;
function IndexOf(AName: string): LongInt;
property Dataset: TDataSet read Get;
property Updated: Boolean read Get write Set;
end;
- TFieldDef = class(TNamedItem)
function AddChild: TFieldDef;
function CreateField(Owner: TComponent; ParentField: TObjectField; FieldName: string; CreateChildren: Boolean): TField;
function HasChildDefs: Boolean;
property FieldNo: LongInt read Get write Set;
property InternalCalcField: Boolean read Get write Set;
property ParentDef: TFieldDef read Get;
property Required: Boolean read Get write Set;
property Attributes: Byte read Get write Set;
property ChildDefs: TFieldDefs read Get write Set;
property DataType: TFieldType read Get write Set;
property Precision: LongInt read Get write Set;
property Size: LongInt read Get write Set;
end;
- TIndexDef = class(TNamedItem)
constructor Create(Owner: TIndexDefs; Name: string; Fields: string; Options: Byte): TIndexDef;
property FieldExpression: string read Get;
property CaseInsFields: string read Get write Set;
property DescFields: string read Get write Set;
property Expression: string read Get write Set;
property Fields: string read Get write Set;
property Options: Byte read Get write Set;
property Source: string read Get write Set;
property GroupingLevel: LongInt read Get write Set;
end;
- TFlatList = class(TStringList)
constructor Create(ADataSet: TDataSet): TFlatList;
procedure Update;
property Dataset: TDataSet read Get;
end;
- TFieldDefList = class(TFlatList)
function FieldByName(Name: string): TFieldDef;
function Find(Name: string): TFieldDef;
property FieldDefs(param1: LongInt): TFieldDef read Get;
end;
- TFieldList = class(TFlatList)
function FieldByName(Name: string): TField;
function Find(Name: string): TField;
property Fields(param1: LongInt): TField read Get;
end;
- TFields = class(TObject)
constructor Create(ADataSet: TDataSet): TFields;
procedure Add(Field: TField);
procedure CheckFieldName(FieldName: string);
procedure CheckFieldNames(FieldNames: string);
procedure Clear;
function FindField(FieldName: string): TField;
function FieldByName(FieldName: string): TField;
function FieldByNumber(FieldNo: LongInt): TField;
function IndexOf(Field: TField): LongInt;
procedure Remove(Field: TField);
property Count: LongInt read Get;
property Dataset: TDataSet read Get;
property Fields(param1: LongInt): TField read Get write Set;
end;
- TLookupList = class(TObject)
constructor Create: TLookupList;
procedure Add(AKey: Variant; AValue: Variant);
procedure Clear;
function ValueOfKey(AKey: Variant): Variant;
end;
- TStringField = class(TField)
property Value: string read Get write Set;
property FixedChar: Boolean read Get write Set;
property Transliterate: Boolean read Get write Set;
end;
- TWideStringField = class(TStringField)
property Value: WideString read Get write Set;
end;
- TNumericField = class(TField)
property DisplayFormat: string read Get write Set;
property EditFormat: string read Get write Set;
end;
- TIntegerField = class(TNumericField)
property Value: LongInt read Get write Set;
property MaxValue: LongInt read Get write Set;
property MinValue: LongInt read Get write Set;
end;
- TSmallintField = class(TIntegerField)
end;
- TLargeintField = class(TNumericField)
property AsLargeInt: Int64 read Get write Set;
property Value: Int64 read Get write Set;
property MaxValue: Int64 read Get write Set;
property MinValue: Int64 read Get write Set;
end;
- TWordField = class(TIntegerField)
end;
- TAutoIncField = class(TIntegerField)
end;
- TFloatField = class(TNumericField)
property Value: Double read Get write Set;
property Currency: Boolean read Get write Set;
property MaxValue: Double read Get write Set;
property MinValue: Double read Get write Set;
property Precision: LongInt read Get write Set;
end;
- TCurrencyField = class(TFloatField)
end;
- TBooleanField = class(TField)
property Value: Boolean read Get write Set;
property DisplayValues: string read Get write Set;
end;
- TDateTimeField = class(TField)
property DisplayFormat: string read Get write Set;
end;
- TDateField = class(TDateTimeField)
end;
- TTimeField = class(TDateTimeField)
end;
- TBinaryField = class(TField)
end;
- TBytesField = class(TBinaryField)
end;
- TVarBytesField = class(TBytesField)
end;
- TBCDField = class(TNumericField)
property Value: Currency read Get write Set;
property Currency: Boolean read Get write Set;
property MaxValue: Currency read Get write Set;
property MinValue: Currency read Get write Set;
property Precision: LongInt read Get write Set;
end;
- TFMTBCDField = class(TNumericField)
property Currency: Boolean read Get write Set;
property MaxValue: string read Get write Set;
property MinValue: string read Get write Set;
property Precision: LongInt read Get write Set;
end;
- TBlobField = class(TField)
procedure LoadFromFile(FileName: string);
procedure SaveToFile(FileName: string);
property BlobSize: LongInt read Get;
property Modified: Boolean read Get write Set;
property Value: string read Get write Set;
property Transliterate: Boolean read Get write Set;
property BlobType: Byte read Get write Set;
property GraphicHeader: Boolean read Get write Set;
end;
- TMemoField = class(TBlobField)
end;
- TGraphicField = class(TBlobField)
end;
- TADTField = class(TObjectField)
end;
- TArrayField = class(TObjectField)
end;
- TDataSetField = class(TObjectField)
property NestedDataSet: TDataSet read Get;
property IncludeObjectField: Boolean read Get write Set;
end;
- TReferenceField = class(TDataSetField)
property ReferenceTableName: string read Get write Set;
end;
- TVariantField = class(TField)
end;
- TGuidField = class(TField)
end;
- TParams = class(TCollection)
procedure AssignValues(Value: TParams);
procedure AddParam(Value: TParam);
procedure RemoveParam(Value: TParam);
function CreateParam(FldType: TFieldType; ParamName: string; ParamType: Byte): TParam;
function IsEqual(Value: TParams): Boolean;
function ParseSQL(SQL: string; DoCreate: Boolean): string;
function ParamByName(Value: string): TParam;
function FindParam(Value: string): TParam;
property Items(param1: LongInt): TParam read Get write Set;
property ParamValues(param1: string): Variant read Get write Set;
end;
Зависимости
Плагин зависит от следующих типов и классов, которые должны быть обьявлены предварительно:- TDataSetErrorEvent = 'procedure (Dataset: TDataSet; E: TObject; var Action: TDataAction)');
— требует ссылки на TObject (плагин PSImport_Classes);
- +3
- 07 октября 2022, 21:14
- anakost
Комментарии (0)
RSS свернуть / развернуть