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. ACM-ICPC 2018 徐州赛区网络预赛 B. BE, GE or NE

    In a world where ordinary people cannot reach, a boy named "Koutarou" and a girl named &qu ...

  2. 为工程添加上下文菜单(ContextMenu)

    上下文菜单大多数情况下都是为ListView中的Item添加的,长按2S左右跳出菜单,添加上下文菜单必须重写活动中的onCreateContextMenu()方法和onContextItemSelec ...

  3. 可持久化treap(FHQ treap)

    FHQ treap 的整理 treap = tree + heap,即同时满足二叉搜索树和堆的性质. 为了使树尽可能的保证两边的大小平衡,所以有一个key值,使他满足堆得性质,来维护树的平衡,key值 ...

  4. cache共享问题

    经测试发现,cache在web中与windows service中是不能共享的.但在windows service可以使用cache.

  5. xml了解

    Xml简介 ➢XML指可扩展标记语言(Extensible Markup Language) ➢XML被设计用于结构化.存储和传输数据 ➢XML是一种标记语言,很类似于HTML ➢XML没有像HTML ...

  6. Python面试题(练习二)

    1.用Python实现一个二分查找的函数. data = [1, 3, 6, 7, 9, 12, 14, 16, 17, 18, 20, 21, 22, 23, 30, 32, 33, 35] def ...

  7. Ubuntu 深度炼丹环境配置

    Ubuntu 深度炼丹环境配置 深度炼丹最麻烦的就是环境配置了,下面过程记录了本人进行深度炼丹环境的配置. 首先是安装图形显卡驱动,按如下指令进行即可 sudo add-apt-repository ...

  8. 优秀的缓存请求库,快速请求接口和图片:WTRequestCenter

    WTRequestCenter 方便缓存的请求库无需任何import和配置,目前实现了基础需求如果有其他需要请在issue 上提出,谢谢! 使用方法 Usage 注意:所有的请求都是缓存的 GET 请 ...

  9. AtCoder Regular Contest 064 F - Rotated Palindromes

    Problem Statement Takahashi and Aoki are going to together construct a sequence of integers. First, ...

  10. oracle主键设置与oracle序列

    第一步:添加主键(如果已有且是自己命名的可略过) 一个表中要有主键,我们建主键的时候要自己命名,如果不是可能在后边遇到“主键唯一,不能自动添加”的问题. 设置主键: alter table " ...