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.

fastscript增加公共函数的更多相关文章

  1. Postman高级应用——流程控制、调试、公共函数、外部数据文件

    postman客户端下载地址:https://www.getpostman.com/apps 目录 流程控制 调试 公共函数 外部数据文件 流程控制 流程控制简言之就是设置接口的执行顺序,流程控制只有 ...

  2. phpcms公共函数库 总结

    *  global.func.php 公共函数库 /** * 返回经addslashes处理过的字符串或数组 * @param $string 需要处理的字符串或数组 * @return mixed ...

  3. fastscript增加三方控件

    fastscript增加三方控件 A.关于如何使用第三方控件,增加方法.属性.事件)举例如下: 如:有一控件为edtbutton:TedtButton,我们需要在动态脚本中使用该控件.我们采用如下方法 ...

  4. cmf公共函数解析

    cmf公共函数解析-common.php 路径:thinkcmf\simplewind\cmf\common.php方法: 方法 作用 返回值 cmf_get_current_admin_id    ...

  5. ThinkPHP 3.2.3 自动加载公共函数文件的方法

    方法一.加载默认的公共函数文件 在 ThinkPHP 3.2.3 中,默认的公共函数文件位于公共模块 ./Application/Common 下,访问所有的模块之前都会首先加载公共模块下面的配置文件 ...

  6. CodeIgniter 引入自定义公共函数

    CodeIgniter 中公共函数不能追加,可以通过 helper 辅助函数实现. 创建 common_helper.php 文件,定义所需公共函数,存放至 application/helpers 目 ...

  7. ThinkPHP第三天(公共函数Common加载,dump定义,模板文件,定义替换__PUBLIC__)

    1.公共函数定义 自动加载:在项目的common文件夹中定义,公共函数文件命名规则为common.php,只有命名成common.php才能被自动载入. 动态加载:可以修改配置项‘LOAD_EXT_F ...

  8. 【ASP.NET】怎样使用类创建公共函数,在不同ASP.NET页面间反复调用

    为了降低代码冗余,应将公共函数写在类中,供不同ASP.NET页面调用. 1,先新建一个类,并在类中加入函数逻辑 namespace public_function_demo { public clas ...

  9. postman定义公共函数

    对于postman定义公共函数,相信很多小伙伴并不是很了解,下面给大家带来了一点福利,一起来看看吧.1.判断是否超时(assertNotTimeout)

随机推荐

  1. 欧拉函数:HDU3501-Calculation 2

    Calculation 2 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Probl ...

  2. bs4--官文--搜索文档树

    搜索文档树 Beautiful Soup定义了很多搜索方法,这里着重介绍2个: find() 和 find_all() .其它方法的参数和用法类似,请读者举一反三. 再以“爱丽丝”文档作为例子: ht ...

  3. BZOJ 4985: 评分

    二分答案 >=key的记为1 f[i]表示令i位置为1所需要的最少的1的个数 队列模拟 #include<cstdio> #include<algorithm> usin ...

  4. LA 4094 WonderTeam 构造

    题意: 一共有\(n\)支队伍参加比赛,每两支队伍比赛两场,主客场各一场. 胜场得\(3\)分,平局得1分,败场不得分. 一支得分为\(p\)的队伍的排名\(=\)分数大于\(p\)的队伍数\(+1\ ...

  5. Diango 一——URL

    内容概要 1.web框架初识 2.MTV模式 3.Django创建流程和命令行工具 4.配置文件  settings 5.视图函数  views 6.路由系统  URL 7.模板系统  templat ...

  6. configparser模块——用于生成和修改常见配置文档

    配置文档格式 [DEFAULT] ServerAliveInterval = 45 Compression = yes CompressionLevel = 9 ForwardX11 = yes [b ...

  7. 为Anaconda添加新的源

    为Anaconda添加新的源 在cmd中输入以下内容即可, 清华的源,速度非常快 conda config --add channels https://mirrors.tuna.tsinghua.e ...

  8. [转]物理CPU、CPU核数、逻辑CPU、超线程

    转自:http://wulc.me/2016/01/06/物理CPU.CPU核数.逻辑CPU.超线程/ 基本概念 物理CPU: 物理CPU就是插在主机上的真实的CPU硬件,在Linux下可以数不同的p ...

  9. 在Asp.net MVC中应该怎样使用Spring.Net

    简单工厂 专门定义一个类来负责创建其他类的实例,被创建的实例通常都具有共同的父类或接口.简单工厂模式又称为静态工厂方法(Static Factory Method)模式,属于类的创建型模式,通常根据一 ...

  10. netcore命令行部署|跨域问题

    1.在hosting中修改发布端口号,如遇见不识别IP则改成*再用命令行运行 { "server.url": "http://*:8089"} 3.给接口开外网 ...