RunEx

Purpose

This function runs a function in a script with a parameter.  This will also return a value from the called script.

Parameters

Parameter: scr
Type: string
Description: This is the file name of the script to run.  Do not include the path in the script name.

Parameter: func
Type: string
Description: This is the name of the function to execute.

Parameter: param
Type: variant
Description: This is a  parameter to send to the function.  This can be a string or numeric value.

Returns

Return value: value
Type: variant
Description: This returns any value that the called script returns.

Example

Consider the following script named test.txt:

launch_app(appname)

hs.Launch appname
' now return some text to the caller
launch_app = "The application is launched"

end sub

The above script could be called using the RunEx call from another script like:

sub main()

dim s
' call the script and get the return value

s = hs.RunEx("test.txt","launch_app","notepad.exe")

' display the returned string

msgbox s

end sub