fastscript增加公共函数

fastscript增加公共函数

unit fs_BsCommFuncs;


interface
{$i fs.inc}
uses
SysUtils, Classes, fs_iclassesrtti, fs_iinterpreter,fs_ipascal;
type
TBsCommFunctions = class(TfsRTTIModule)
private
function CallMethod(Instance: TObject; ClassType: TClass;
const MethodName: String; Caller: TfsMethodHelper): Variant;
public
constructor Create(AScript: TfsScript); override;
end;
VAR BsCommFunctions:TBsCommFunctions;
implementation
uses MainModule,Bs_BaseList,Bs_BaseEdit,Bs_Math,uniPageControl;

function GetUserCode():string; //获取用户代码
var tempMainModule:TUniMainModule;
begin
Result := '';
tempMainModule := UniMainModule;
Result := tempMainModule.FuserCode;
end;

function Get_GUID(): string;
begin
Result := GetGUID;
end;

constructor TBsCommFunctions.Create(AScript: TfsScript);
begin
inherited Create(AScript);
with AScript do
begin
//--------------模块接口方法--------//
AddMethod('function var_UserCode():string', CallMethod);
AddMethod('function GetGUID():string', CallMethod);

AddMethod('procedure ShowListA(QModueleCode:string;QTabSheet:TUniTabSheet)',CallMethod);
AddMethod('procedure BaseEditA(QModueleCode:string;QKeyValue:string)',CallMethod);
end;
end;

function TBsCommFunctions.CallMethod(Instance: TObject; ClassType: TClass;
const MethodName: String; Caller: TfsMethodHelper): Variant;
begin
if MethodName='VAR_USERCODE' then
Result := GetUserCode()
else
if MethodName='GETGUID' then
Result := Get_GUID()
else
if MethodName='SHOWLISTA' then
ShowList_A(Caller.Params[0],TUniTabSheet(Integer(Caller.Params[1])))
else
if MethodName='BASEEDITA' then
BaseEdit_A(Caller.Params[0],Caller.Params[1])
end;

end.

转载于:https://www.cnblogs.com/hnxxcxg/p/6386509.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值