delphi 主程序装载脚本


本文整理自网络,侵删。

 
主程序装载脚本
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 利用csidl打开特殊文件夹

Delphi 莫名奇妙的错误 Delphi is not a valid integer value

Delphi application.messagebox 详解

Delphi 获取jpg文件宽度高度的方法

Delphi源码一个对字符加密解密的实例

Delphi 获取窗体坐标触发事件

Delphi 窗体不可用

Delphi 由类名获取父类

Delphi旋转位图

Delphi recodedatetime、recodedate、recodetime、recodeyear ... 修改时间

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...