First Scripting Application |
Top Previous Next |
Here you can find a walk-though for creating a simple application capable of running VBScript scripts. Let's suppose that there'll be Main procedure in the script which will accept two integers num1 and num2, and return their sum which will then be displayed to a user (see code sample below).
The following steps have to be performed to create the application:
Sub Main(num1, num2) res = num1 + num2 MsgBox res End Sub
procedure TForm1.Button1Click(Sender: TObject); begin LMDScriptControl1.Source := Memo1.Lines; try LMDScriptControl1.Open; LMDScriptControl1.RunProc('Main', [3, 7]); finally LMDScriptControl1.Close; end; end;
|