主程序装载脚本

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文件来对应不同的语言即可。

相关文章:

  • 2021-11-05
  • 2021-07-13
  • 2022-12-23
  • 2021-06-03
  • 2022-12-23
  • 2021-07-12
猜你喜欢
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2021-09-21
相关资源
相似解决方案