How do i handle these situations?

edited December 2005 in FastScript
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

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.