JavaScript global method: execute

Validates the syntax of the specified JavaScript, and then runs it.

Syntax

execute( script, description );

Arguments

The following arguments are valid for this function:

Argument Data type Required Description
script String Yes This argument contains the name of the script you want to validate.
description String No Use this argument to store any comments you want.

Return values

A success or error message.

This method displays the Successful compilation of JavaScript function or expression message if the JavaScript passes validation.

Throws

None

Description

This method validates the syntax of a JavaScript, and then runs it. The method also displays a message as to the success or failure of the validation.

Example

This example does the following:

  • Creates a variable to store a JavaScript name
  • Validates the contents of the script
  • Runs the script

This example requires the following sample data:

  • A valid JavaScript
var s = "lib.SCFILEgetTextTest"
execute( s, "Testing execute" );