$WBIRUN - execute inline script

Important: $WBIRUN function uses safe subset which means that scripting engine is only allowed to create or use objects that are marked safe for scripting.

Availability
$WBIRUN is available for use with all WBSP commands in scripting languages listed in Execute variable of WBSP.ssc file.

Syntax
$WBIRUN{Language|function(fnargs)|ScriptCode}
$WBIRUN[Language|function(fnargs)|ScriptCode]

Parameters
language - name of the scripting language used in script (e.g. JavaScript, VBScript, JScript, etc.)
function - name of the function that should be executed - fnargs are arguments required by the script function, not by the WBSP
scriptcode - actual script code that should be executed


Returns
Result returned by script function.

Example

[FormFields]
wb_command=R
wb_showlogo=F
<!--WB_BeginTemplate-->
<html>
<body>
This server uses $wbirun[VBScript|GetScriptEngineInfo|
Function GetScriptEngineInfo
   s = ""
   s = ScriptEngine & " Version "
   s = s & ScriptEngineMajorVersion & "."
   s = s & ScriptEngineMinorVersion & "."
   s = s & ScriptEngineBuildVersion
   GetScriptEngineInfo = s
End Function
]
</body>
</html>

 

After running this example, the resulting page in web browser may look like this:

This server uses VBScript Version 5.8.16990