ClearScript Library
ClearScript Library
ClearScript Library Reference
Microsoft.ClearScript
ScriptEngine Class
ScriptEngine Methods
Execute Method
Execute(String) Method
Execute(DocumentInfo, String) Method
Execute(String, String) Method
Execute(String, Boolean, String) Method

# ScriptEngineExecute(String, Boolean, String) Method

Executes script code with an associated document name, optionally discarding the document after execution.
Namespace: Microsoft.ClearScript
Assembly: ClearScript.Core (in ClearScript.Core.dll) Version: 7.5.0
Syntax
C#
VB
C++
F#
Copy

    public void Execute(
    	string documentName,
    	bool discard,
    	string code
    )

    Public Sub Execute (
    	documentName As String,
    	discard As Boolean,
    	code As String
    )

    public:
    virtual void Execute(
    	String^ documentName,
    	bool discard,
    	String^ code
    ) sealed

    abstract Execute :
            documentName : string *
            discard : bool *
            code : string -> unit
    override Execute :
            documentName : string *
            discard : bool *
            code : string -> unit

#### Parameters

documentName String
  A document name for the script code. Currently, this name is used only as a label in presentation contexts such as debugger user interfaces.
discard Boolean
  True to discard the script document after execution, false otherwise.
code String
  The script code to execute.

#### Implements

IScriptEngineExecute(String, Boolean, String)
Remarks

In some script languages the distinction between statements and expressions is significant but ambiguous for certain syntactic elements. This method always interprets the specified script code as a statement.

If a debugger is attached, it will present the specified script code to the user as a document with the specified name. Discarding this document removes it from view but has no effect on the script engine. Only Windows Script engines honor discard.

See Also

#### Reference

ScriptEngine Class
Execute Overload
Microsoft.ClearScript Namespace

Copyright © Microsoft Corporation. All rights reserved.

Send comments on this topic to Microsoft