本文整理自网络,侵删。
主程序装载脚本procedure TForm1.FormCreate(Sender: TObject);begin fsScript1.Clear; fsScript1.Parent := fsGlobalUnit; fsScript1.AddComponent(Form1); fsScript1.Lines.LoadFromFile('1.txt'); fsScript1.Run;end; 1.txt文件uses 'lang.txt'; //引用公用的语言单元 procedure button1click(sender: tobject);begin showmessage('hello');end; begin with form1 do begin button1.caption := const_append; button2.caption := const_save; button1.onclick := @button1click; end;end. Lang.txt公用的语言单元const const_append = '增加'; const_save = '保存'; begin end.使用不同lang.txt文件来对应不同的语言即可。
来源:http://www.cnblogs.com/key-ok/p/3443417.html
相关阅读 >>
Delphi 莫名奇妙的错误 Delphi is not a valid integer value
Delphi application.messagebox 详解
Delphi recodedatetime、recodedate、recodetime、recodeyear ... 修改时间
更多相关阅读请进入《Delphi》频道 >>