function hereString(f) {
return f.toString().
replace(/^[^\/]+\/\*!?/, '').
replace(/\*\/[^\/]+$/, '');
}// ----------------------------------------------------------------
// Step: Display_msgbox_Hello
// ----------------------------------------------------------------
GLOBAL.step({ Display_msgbox_Hello: function(ev, sc, st) {
var rootData = sc.data;
ctx.workflow('HelloWorkflow', '26c01308-c7d9-4e09-a8cc-ba510c04d410') ;
var MSScrCtrl = new ActiveXObject("MSScriptControl.ScriptControl");
MSScrCtrl.AllowUI = 1;
MSScrCtrl.Language = 'VBScript';
MSScrCtrl.ExecuteStatement('MsgBox "Hello World from VBScript in IRPA!", VBOkOnly, "ExecuteStatement"');
var VBSCode = hereString(function() {/*!
Option Explicit
Sub foo()
Dim Text
Text = "Hello World from VBScript in IRPA!"
MsgBox Text, VBOkOnly, "Run"
End Sub
*/});
MSScrCtrl.AddCode(VBSCode);
MSScrCtrl.Run('foo');
MSScrCtrl.Reset();
VBSCode = hereString(function() {/*!
Option Explicit
Function foo(Text)
foo = MsgBox(Text, VBYesNo, "Eval")
End Function
*/});
MSScrCtrl.AddCode(VBSCode);
var MsgBoxText = 'Hello World from VBScript in IRPA';
var FunctionCall = 'foo("' + MsgBoxText + '")';
var res = MSScrCtrl.Eval(FunctionCall);
//res = 6 if Yes or res = 7 if No
ctx.log(res);
MSScrCtrl.Reset();
// Display msgbox 'HelloWorld2019'
// Creates the popup according to selected template, sets title and message and displays it.
var HelloWorld2019 = ctx.popup('HelloWorld2019', e.popup.template.Ok);
HelloWorld2019.open({ title: 'HelloWorld2019', message: "Hello World"});
// Wait until the end user closes the popup.
HelloWorld2019.waitResult(function(res) {
// End user has closed the popup, continue monitoring.
sc.endStep(); // end Scenario
return;
});
}});



You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 3143 | |
| 1916 | |
| 1916 | |
| 1213 | |
| 1079 | |
| 757 | |
| 755 | |
| 742 |