How do i handle these situations?
I am trying to add support for APPENDRECORD & WRAPTEXT to fastscript but i don't know how to handle them in their respective CallFunction(in this case is the _AppendRecord function and _WrapText function)
constructor TFS_TDataSet.Create(AScript: TfsScript);
begin
inherited Create(AScript);
with AScript do begin
AddClass(TDataSet, TDataSet.ClassParent.ClassName);
with FindClass(TDataSet.ClassName) do begin
AddMethod('procedure AppendRecord(var Values: array of TVarRec)', _AppendRecord);
end;
end;
end;
constructor TFunctions.Create(AScript: TfsScript);
begin
inherited Create(AScript);
with AScript do begin
AddMethod('function WrapText(const Line: string; const BreakStr: string; const BreakChars: TSysCharSet; MaxCol: Integer): string', _WrapText);
end;
end;
function TFunctions._WrapText(Instance: TObject; ClassType: TClass;
const MethodName: String; Caller: TfsMethodHelper): Variant;
begin
//How do i handle the Parameter(TSysCharSet) which the caller[2] is pass in? [Pascal Error] E2010 Incompatible types: 'TSysCharSet' and 'Variant'
//Result := WrapText(Caller[0], Caller[1], Caller[2], Caller[3]);
end;
function TFS_TDataSet._AppendRecord(Instance: TObject; ClassType: TClass;
const MethodName: String; Caller: TfsMethodHelper): Variant;
begin
// What should i do here?
// TDataSet(Instance).AppendRecord(Caller[0]); //wrong
end;
Can you someone guide me on how to deal with this?
Hope someone can help me out.
Best regards,
Soo Seong
E Stream Software Sdn Bhd
URL: www.sql.com.my
SQL Financial Accounting
constructor TFS_TDataSet.Create(AScript: TfsScript);
begin
inherited Create(AScript);
with AScript do begin
AddClass(TDataSet, TDataSet.ClassParent.ClassName);
with FindClass(TDataSet.ClassName) do begin
AddMethod('procedure AppendRecord(var Values: array of TVarRec)', _AppendRecord);
end;
end;
end;
constructor TFunctions.Create(AScript: TfsScript);
begin
inherited Create(AScript);
with AScript do begin
AddMethod('function WrapText(const Line: string; const BreakStr: string; const BreakChars: TSysCharSet; MaxCol: Integer): string', _WrapText);
end;
end;
function TFunctions._WrapText(Instance: TObject; ClassType: TClass;
const MethodName: String; Caller: TfsMethodHelper): Variant;
begin
//How do i handle the Parameter(TSysCharSet) which the caller[2] is pass in? [Pascal Error] E2010 Incompatible types: 'TSysCharSet' and 'Variant'
//Result := WrapText(Caller[0], Caller[1], Caller[2], Caller[3]);
end;
function TFS_TDataSet._AppendRecord(Instance: TObject; ClassType: TClass;
const MethodName: String; Caller: TfsMethodHelper): Variant;
begin
// What should i do here?
// TDataSet(Instance).AppendRecord(Caller[0]); //wrong
end;
Can you someone guide me on how to deal with this?
Hope someone can help me out.
Best regards,
Soo Seong
E Stream Software Sdn Bhd
URL: www.sql.com.my
SQL Financial Accounting