zoukankan      html  css  js  c++  java
  • fastscript 经验集

    implementation
    type
      TFunctions = class(TfsRTTIModule)
      private
        function CallMethod(Instance: TObject; ClassType: TClass;
          const MethodName: String; Caller: TfsMethodHelper): Variant;
      public
        constructor Create(AScript: TfsScript); override;
      end;
    
    { TFunctions }
    
    function TFunctions.CallMethod(Instance: TObject; ClassType: TClass;
      const MethodName: String; Caller: TfsMethodHelper): Variant;
    begin
      Result := 0;
      if MethodName = 'ONEKEY' then
        FrmMain.OneKey(Caller.Params[0],Caller.Params[1],Caller.Params[2],Caller.Params[3])
      else  if MethodName = 'ONEKEY2' then
        FrmMain.OneKey(Caller.Params[0],Caller.Params[1])
      else if MethodName = 'GETTEXT' then
        Result := FrmMain.GetText(Caller.Params[0])
      else if MethodName = 'NEXTLINE' then
        FrmMain.NextLine
      else if MethodName = 'SLEEP' then
         Sleep1(FrmMain.se.Value)
      else if MethodName = 'QUERYCANCEL' then
         Result := FrmMain.FCancel;
    end;
    
    constructor TFunctions.Create(AScript: TfsScript);
    begin
      inherited Create(AScript);
      AScript.AddMethod('procedure OneKey(key1:Byte; ext1:Boolean;key2:Byte; ext2:Boolean)', CallMethod);
      AScript.AddMethod('procedure OneKey2(key:Byte; ext:Boolean = false)', CallMethod);
      AScript.AddMethod('function GetText(i: Integer):string', CallMethod);
      AScript.AddMethod('procedure NextLine', CallMethod);
      AScript.AddMethod('procedure sleep', CallMethod);
      AScript.AddMethod('function querycancel:boolean', CallMethod);
    end;
    
    
    
    initialization
      fsRTTIModules.Add(TFunctions);
    
    finalization
      fsRTTIModules.Remove(TFunctions);
    end.
    View Code
  • 相关阅读:
    如何做实时监控?—— 参考 Spring Boot 实现
    如何做实时监控?—— 参考 Spring Boot 实现
    spring boot application properties配置详解
    Jrebel 6.2.1破解
    智能社-JS -wiki
    hibernate.properties
    Tomcat 的 socket bind failed的解决方法
    js 排序 SORT 各种方法
    java EE 如何使用Eclipse启动一个项目
    2016-06-06 数组的几个重要方法
  • 原文地址:https://www.cnblogs.com/khzide/p/4460346.html
Copyright © 2011-2022 走看看