Functions

Old Content - visit altium.com/documentation

Parent page: JScript

JScript Functions

JScript functions are based on built-in objects such as the Math object and Data object, which can have their methods invoked to acquire the required data.

Built in functions

Altium Designer's scripting engine provides JScript language built-in objects that can be used in scripts. These objects have methods and properties that can be invoked in scripts.

Example using the built-in Date object

 function DateDemo(){    var d , s = "Today's date is: ";          //Declare variables    d = new Date();                           //Create Date object    s += (d.getMonth() + 1) + "/";            //Get month    s += d.getDate() + "/";                   //Get day    s += d.getYear();                         //Get year    showmessage(s);                           //Display the date. } 

Built-in Objects table

Language Element

Description

ActiveXObject Object

Enables and returns a reference to an Automation object

Array Object

Provides support for creation of arrays of any data type

arguments Object

An object representing the arguments to the currently executing function, and the functions that called it

Boolean Object

Creates a new Boolean value.

Date Object

Enables basic storage and retrieval of dates and times.

Debug Object

An intrinsic object that can send output to a script debugger.

Enumerator Object

Enables enumeration of items in a collection.

Error Object

An object that contains information about errors that occur while JScript code is running.

Function Object

Creates a new function.

Global Object

An intrinsic object whose purpose is to collect global methods into one object.

Math Object

An intrinsic object that provides basic mathematics functionality and constants.

Number Object

An object representation of the number data type and placeholder for numeric constants.

Object Object

Provides functionality common to all JScript objects.

RegExp Object

Stores information on regular expression pattern searches.

Regular Expression Object

Contains a regular expression pattern.

String Object

Allows manipulation and formatting of text strings and determination and location of substrings within strings

VBArray Object

Provides access to Visual Basic safe arrays.

You are reporting an issue with the following selected text and/or image within the active document: