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.

  • 相关阅读:
    nyoj 17 单调递增最长子序列
    nyoj 18 The Triangle
    nyoj 712 探 寻 宝 藏
    nyoj 61传纸条(一)
    nyoj 269 VF
    nyoj 44 子串和
    nyoj 252 01串
    nyoj 42 一笔画问题
    nyoj 756 重建二叉树
    Table 样式设置
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/6406351.html
Copyright © 2011-2022 走看看