ExecuteScript()

This code sample describes how to create a script that locates and runs the callback script that is associated with this custom display step.

	Function Boolean ExecuteScript( \
		Object prgCtx, \
		WAPIWORK work, \
		Dynamic taskInfo, \
		String scriptName )

		Boolean success = True
		Dynamic err = Undefined

		String moduleDir = $Custmod.custtaskmodule.PathPrefix()
		String scriptsDir = moduleDir + "scripts" + File.Separator()
		String scriptFile = scriptsDir + scriptName

		//Convert the HTML files that have OScript in them to pure HTML.

		Dynamic result = $WebLingo.WebScript.RunFileWithArglist( \
									scriptFile, \
									Undefined, \
									Undefined, \
									{ prgCtx, work, taskInfo }, \
									true )
		if ( Type( result ) == ListType )
			echo( "Error during $WebLingo.WebScript.RunFile =", result )
			success = false
		elseif IsNotError( result )
			success = true
		else
			echo( "Error during $WebLingo.WebScript.RunFile =", result )
			success = false
		end
		return( success )
	end