zoukankan      html  css  js  c++  java
  • fastscript例子一

    fastscript例子一

    unit Unit1;

    interface

    uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes
    , Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, fs_ipascal, fs_iformsrtti, 
    fs_iinterpreter;

    type
    TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    fsScript1: TfsScript;
    fsPascal1: TfsPascal;
    procedure FormCreate(Sender: TObject);
    private
    { Private declarations }
    public
    { Public declarations }
    end;

    var
    Form1: TForm1;

    implementation

    {$R *.dfm}

    { 脚本
    procedure btnclick(sender: tobject);
    begin
    showmessage('hello');
    end;

    begin
    form1.button1.onclick:=@btnclick;
    end.
    }
    procedure TForm1.FormCreate(Sender: TObject);
    begin
    fsScript1.Clear;
    fsScript1.Parent := fsGlobalUnit;
    fsScript1.AddComponent(Form1);
    fsScript1.Lines.Assign(Memo1.Lines);
    fsScript1.Run;
    end;

    end.

  • 相关阅读:
    mysql事务
    数据类型
    win10 开启全局代理
    高并发的一些思考
    多线程也不一定比单线程快
    单线程的JavaScript
    Vue2 响应式原理
    检查Object是否存在某个属性
    堆和栈
    LeetCode
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/6406351.html
Copyright © 2011-2022 走看看