with

Establishes the default object for a set of statements.

Syntax

with ( object )
{
statements
}

Parameters

Parameter Description
object Specifies the default object to use for the statements. The parentheses around object are required.
statements Any block of statements.

Description

MetaScript looks up any unqualified names within the set of statements to determine if the names are properties of the default object. If an unqualified name matches a property, then the property is used in the statement; otherwise, a local or global variable is used.

Examples

The following with statement specifies that the Math object is the default object. The statements following the with statement refer to the Math.PI property and the Math.cos and Math.sin methods, without specifying an object. MetaScript assumes the Math object for these references.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.