Table of Contents:
Microsoft JScript 3.0 Functions/Constants

Workarounds Available:
 
$&
$*
$_
$+
$1
$2
$3
$4
$5
$6
$7
$8
$9
===
charCodeAt
compile
concat
dimensions
Do
exec
fromCharCode
getFullYear
getItem
getMilliseconds
getUTCDate
getUTCDay
getUTCFullYear
getUTCHours
getUTCMilliseconds
getUTCMinutes
getUTCMonth
getUTCSeconds
Infinity
input
isFinite
item
lastIndex
lastMatch
lastParen
leftContext
multiline
RegExp
Regular Expression
rightContext
setFullYear
setMilliseconds
setUTCDate
setUTCFullYear
setUTCHours
setUTCMilliseconds
setUTCMinutes
setUTCMonth
setUTCSeconds
slice
source
substr
Switch
test
toArray
ubound

No Workarounds Available:
 
!==
@cc_on
@if
@set
ActiveXObject
Add
atEnd
Attributes
AvailableSpace
BuildPath
Copy
CopyFile
CopyFolder
CreateFolder
DateCreated
DateLastAccessed
DateLastModified
Delete
DeleteFile
DeleteFolder
Drive
DriveExists
DriveLetter
Drives
DriveType
Enumerator
File
FileExists
Files
FileSystem
Folder
FolderExists
FreeSpace
GetAbsolutePathName
GetBaseName
GetDrive
GetDriveName
GetExtensionName
GetFile
GetFileName
GetFolder
GetObject
GetParentFolderName
GetSpecialFolder
GetTempName
getVarDate
Global
global
ignoreCase
index
IsReady
IsRootFolder
lbound
Move
MoveFile
moveFirst
MoveFolder
moveNext
Name
Object
OpenAsTextStream
ParentFolder
Path
RootFolder
SerialNumber
ShareName
ShortName
ShortPath
Size
SubFolders
TotalSize
toUTCString
Type
VBArray
VolumeName

ActiveXObject

Areas Affected:
JScript 3.0 Object 



Background Information:
Automation servers provide at least one type of object. For example, a word-processing application may provide an application object, a document object, and a toolbar object. To create an Automation object, assign the new ActiveXObject to an object variable:

var ExcelSheet;
ExcelSheet = new ActiveXObject("Excel.Sheet");

This code starts the application creating the object (in this case, a Microsoft Excel worksheet). Once an object is created, you refer to it in code using the object variable you defined.



Workaround:
 
Javascript 1.2 Absolutely no way of using an ActiveX Object
Javascript 1.1 Absolutely no way of using an ActiveX Object
Javascript 1.0 Absolutely no means of using an ActiveX Object
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

RegExp

Areas Affected:
JScript 3.0 Object - Regular Expression 



Background Information:
Stores information on regular expression pattern searches.



Workaround:
 
Javascript 1.2 Follows the RegExp object structure that is common to JavaScript 1.2 
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

Regular Expression

Areas Affected:
JScript 3.0 Object - Regular Expression



Background Information:
Regular Expression objects store patterns used when searching strings for character combinations. After the Regular Expression object is created, it is either passed to a string method, or a string is passed to one of the regular expression methods. Information about the most recent search performed is stored in the RegExp object.


Workaround:
 
Javascript 1.2 Follows the regular expression structure that is common to JavaScript 1.2
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

$_, lastIndex, lastMatch, $&, lastParen, $+, leftContext, multiline, $*, rightContext, source, $1, $2, $3, $4, $5, $6, $7, $8, $9

Areas Affected:
JScript 3.0 Object - Regular Expression Variables



Background Information:
The value of the $1...$9 properties is modified whenever a successful parenthesized match is made. Any number of parenthesized substrings may be specified in a regular expression pattern, but only the nine most recent can be stored.



Workaround:
 
Javascript 1.2 Same as JScript 3.0 code
Javascript 1.1 RegExp Property - No Workaround exists
Javascript 1.0 RegExp Property - No Workaround exists
JScript 2.0 RegExp Property - No Workaround exists
JScript 1.0 RegExp Property - No Workaround exists
Table of Contents

Infinity

Areas Affected:
JScript 3.0 Function - Global Object



Background Information:
Contains an initial value of Number.POSITIVE_INFINITY. The Infinity property is a member of the Global object, and is made available when the scripting engine is initialized.


Workaround:
 
Javascript 1.2 No Workaround exists
Javascript 1.1 No Workaround exists
Javascript 1.0 At the beginning of the script, insert the following code: 
Infinity = Number.POSITIVE_INFINITY;
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

charCodeAt

Areas Affected:
JScript 3.0 Function - String Object



Background Information:
Returns the Unicode encoding of the specified character.



Workaround:
 
Javascript 1.2 String Object is available within JavaScript 1.2 API
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

compile

Areas Affected:
JScript 3.0 Function - Regular Expression Object



Background Information:
Compiles a regular expression into an internal format.



Workaround:
 
Javascript 1.2 Identical Object within JavaScript 1.2 API
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

concat

Areas Affected:
JScript 3.0 Function - String Object



Background Information:
Returns a String object containing the concatenation of two supplied strings.
The result of the concat method is equivalent to: result = string1 + string2.
The following example illustrates the use of the concat method:

Example:
function concatDemo()
{
  var str1 = "ABCDEFGHIJKLM"
  var str2 = "NOPQRSTUVWXYZ";
  var s = str1.concat(str2);
  // Return concatenated string.
  return(s);
}



Workaround:
 
Javascript 1.2 String Object is available within the JavaScript 1.2 API
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

dimensions

Areas Affected:
JScript 3.0 Function - VBArray Object



Background Information:
The latest release of JavaScript, 1.2, has functionality embedded into it for determining the number of arguments that will are expected for a function call. That feature comes in the form of functionName.arity.



Workaround:
 
Javascript 1.2 See JavaScript 1.1 entry
Javascript 1.1 Array object available with JavaScript 1.1 Object. 

Within the Array Object, all functionality provided within the VBArray object can be mimicked. 

Multiple dimensional arrays are possible by nesting array objects within a new Array object. For each element, the length of the array object can be found which would provide the dimension for that set. 

function dimension(level, arrayIn) 

   var tempArray = new Array() 
   tempArray = arrayIn[level]; 

   return tempArray.length; 

row1 = new Array(2); 
row2 = new Array(3); 

rows = new Array(row1, row2); 

alert(dimension(0, rows)); 

Returns a value of 2 - the length of the first array element. 
 

Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

ubound

Areas Affected:
JScript 3.0 Function - VBArray Object



Background Information:
VBArray returns the upper limit of a VBArray object.



Workaround:
 
Javascript 1.2 See JavaScript 1.1 entry
Javascript 1.1 Array object available with JavaScript 1.1 Object. 

Within the Array Object, all functionality provided within the VBArray object can be mimicked. 

Multiple dimensional arrays are possible by nesting array objects within a new Array object. For each element, the length of the array object can be found which would provide the dimension for that set. 

function ubound(level, arrayIn) 

   var tempArray = new Array() 
   tempArray = arrayIn[level]; 

   return tempArray.length; 

row1 = new Array(2); 
row2 = new Array(3); 

rows = new Array(row1, row2); 

alert(ubound(0, rows)); 

Returns a value of 2 - the upper bound of the first array element. 

Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

getItem

Areas Affected:
JScript 3.0 Function - VBArray Object



Background Information:
Retrieves the item at the specified location.



Workaround:
 
Javascript 1.2 See JavaScript 1.1 entry
Javascript 1.1 Array object available with JavaScript 1.1 Object. 

Within the Array Object, all functionality provided within the VBArray object can be mimicked. 

Multiple dimensional arrays are possible by nesting array objects within a new Array object. For each element, the length of the array object can be found which would provide the dimension for that set. 

function getItem(level, arrayIn, pos) 

   var tempArray = new Array(); 
   tempArray = arrayIn[level]; 
   return tempArray[pos]; 

row1 = new Array(1, 2, 3); 
row2 = new Array(4, 5, 6, 7); 

rows = new Array(row1, row2); 

alert(getItem(0, rows, 0)); 

Returns a value of 1 - the first element in row1.

Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

lbound

Areas Affected:
JScript 3.0 Function - VBArray Object



Background Information:
Returns the lowest index value used in the specified dimension of a VBArray.



Workaround:
 
Javascript 1.2 See JavaScript 1.1 entry
Javascript 1.1 Since the array object within the JavaScript 1.1 API can only have a lower bound of 0, this functionality can not be worked around.
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

toArray

Areas Affected:
JScript 3.0 Function - VBArray Object



Background Information:
Converts a VBArray to a standard JScript array.



Workaround:
 
Javascript 1.2 Using the Array object and the concat method, one could easily mimic this functionality. 
The concat method blends two arrays together and returns one JScript array. 

Example: 

function toArray(arrayIn) 

   var tempArray = new Array(); 
   while(arrayIn.length > 2) 
   { 
       tempArray = arrayIn[arrayIn.length-1].concat(arrayIn[arrayIn.length]); 
       arrayIn[arrayIn.length-1] = tempArray; 
       arrayIn.length = arrayIn.length-1; 
   } 

This example could be expanded out to multi-dimensional arrays as well.

Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

exec

Areas Affected:
JScript 3.0 Function - Regular Expression Object



Background Information:
Executes a search for a match in a specified string.



Workaround:
 
Javascript 1.2 Follows an identical regular expression object model in the JavaScript 1.2 API
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

test

Areas Affected:
JScript 3.0 Function - Regular Expression Object



Background Information:
Tests whether a pattern exists in a string. The test method checks to see if a pattern exists within a string and returns true if so, and false otherwise.
The RegExp object is not modified by the test method.



Workaround:
 
Javascript 1.2 The Regular Expression object has an identical object model in the JavaScript 1.2 API
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

fromCharCode

Areas Affected:
JScript 3.0 Function - String Object



Background Information:
Creates a string from a number of Unicode character values.



Workaround:
 
Javascript 1.2 String Object in JavaScript 1.2 API has an identical function to JScript 3.0 API's
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

getFullYear

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
The getFullYear method returns the year as an absolute number. For example, the year 1976 is returned as 1976. This avoids problems with dates occuring at the end of the 20th century.

Example:

function DateDemo()
{
  var d, s = "Today's UTC date is: ";
  d = new Date();
  s += (d.getMonth() + 1) + "/";
  s += d.getDate() + "/";
  s += d.getFullYear();
  return(s);
}



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0
// dateOBJ is a date object passed as a parameter. 
//The year is returned from this function.
function getFullYear( dateOBJ ) {
        nYear = date.getYear();
        if( 0 <= nYear <= 99 ) {
                nYear += 1900;
        }
        return nYear;
}
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

getMilliseconds

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
Retrieves the number of milliseconds past the second from the milliseconds value stored in a Date object according to local time.



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0
// d is a date object. Function returns a Natural number.
function getMilliseconds( d ) {
        var date = new Date( d.getYear(), d.getMonth(), d.getDate(), 
                d.getHours(), d.getMinutes(), d.getSeconds() );
        return ( d.getTime() - date.getTime() );
}
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

getUTCDate

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
Returns the date of the month stored in a Date object according to Universal Coordinated Time (UTC).



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0 // pass in a date object
function getUTCDate( date ) {
return _convertToUTCDateObject( date ).getDate();
}

// Internal function that is required.
function _convertToUTCDateObject( date ) {
return new Date( date.getTime() 
+ date.getTimezoneOffset() * 60 * 1000 );
}

JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

getUTCDay

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
Returns the day of the month stored in a Date object according to Universal Coordinated Time (UTC).



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0 // pass in a date object
function getUTCDay( date ) {
return _convertToUTCDateObject( date ).getDay();
}

// Internal function that is required.
function _convertToUTCDateObject( date ) {
return new Date( date.getTime() 
+ date.getTimezoneOffset() * 60 * 1000 );
}

JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

getUTCFullYear

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
Returns the year stored in a Date object according to Universal Coordinated Time (UTC).



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0 // pass in a date object
function getUTCFullYear( date ) {
return getFullYear( _convertToUTCDateObject( date ) );
}

// Internal function that is required.
function _convertToUTCDateObject( date ) {
return new Date( date.getTime() 
+ date.getTimezoneOffset() * 60 * 1000 );
}

JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

getUTCHours

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
The getUTCHours method returns an integer between 0 and 23 indicating the number of hours since midnight. A zero occurs in two situations: the time is before 1:00:00 A.M., or a time was not stored in the Date object when the object was created. The only way to determine which situation you have is to also check the minutes and seconds for zero values. If they are all zeroes, it is nearly certain that the time was not stored in the Date object.

Example:

function UTCTimeDemo()
{
  var d, s = "Current Universal Coordinated Time (UTC) is: ";
  var c = ":";
  d = new Date();
  s += d.getUTCHours() + c;
  s += d.getUTCMinutes() + c;
  s += d.getUTCSeconds() + c;
  s += d.getUTCMilliseconds();
  return(s);
}



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0 // pass in a date object
function getUTCHours( date ) {
return _convertToUTCDateObject( date ).getHours();
}

// Internal function that is required.
function _convertToUTCDateObject( date ) {
return new Date( date.getTime() 
+ date.getTimezoneOffset() * 60 * 1000 );
}

JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

getUTCMilliseconds

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
Retrieves the number of milliseconds past the second from the milliseconds value stored in a Date object according to Universal Coordinated Time (UTC).



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0 // pass in a date object
function getUTCMilliseconds( date ) {
return getMilliseconds( _convertToUTCDateObject( date ) )
}

// Internal function that is required.
function _convertToUTCDateObject( date ) {
return new Date( date.getTime() 
+ date.getTimezoneOffset() * 60 * 1000 );
}

JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

getUTCMinutes

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
The getUTCMinutes method returns an integer between 0 and 59 equal to the number of minutes stored in the Date object. A zero occurs in two situations: the time is less than one minute after the hour, or a time was not stored in the Date object when the object was created. The only way to determine which situation you have is to also check the hours and seconds for zero values. If they are all zeroes, it is nearly certain that the time was not stored in the Date object.

Example:

function UTCTimeDemo()
{
  var d, s = "Current Universal Coordinated Time (UTC) is: ";
  var c = ":";
  d = new Date();
  s += d.getUTCHours() + c;
  s += d.getUTCMinutes() + c;
  s += d.getUTCSeconds() + c;
  s += d.getUTCMilliseconds();
  return(s);
}



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0 // pass in a date object
function getUTCMinutes( date ) {
return _convertToUTCDateObject( date ).getMinutes();
}

// Internal function that is required.
function _convertToUTCDateObject( date ) {
return new Date( date.getTime() 
+ date.getTimezoneOffset() * 60 * 1000 );
}

JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

getUTCMonth

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
The getUTCMonth method returns an integer between 0 and 11 indicating the month stored in the Date object. The integer returned is not the traditional number used to indicate the month. It is one less. If "Jan 5, 1996 08:47:00.0" is stored in a Date object, getUTCMonth returns 0.



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0 // pass in a date object
function getUTCMonth( date ) {
return _convertToUTCDateObject( date ).getMonth();
}

// Internal function that is required.
function _convertToUTCDateObject( date ) {
return new Date( date.getTime() 
+ date.getTimezoneOffset() * 60 * 1000 );
}

JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

getUTCSeconds

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
The getUTCSeconds method returns an integer between 0 and 59 indicating the seconds value of the indicated Date object. A zero occurs in two situations: the time is less than one second into the current minute, or a time was not stored in the Date object when the object was created. The only way to determine which situation you have is to also check the minutes and hours for zero values. If they are all zeroes, it is nearly certain that the time was not stored in the Date object.



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0
// pass in a date object
function getUTCSeconds( date ) {
        return _convertToUTCDateObject( date ).getSeconds();
}
// Internal function that is required.
function _convertToUTCDateObject( date ) {
        return new Date( date.getTime() 
                + date.getTimezoneOffset() * 60 * 1000 );
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

getVarDate

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
The getVarDate method is used when interacting with ActiveX® objects or other objects that accept and return date values in VT_DATE format.



Workaround:
 
Javascript 1.2 No Workaround exists
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

isFinite

Areas Affected:
JScript 3.0 Function - Global Object



Background Information:
The isFinite method returns true if number is any value other than NaN, negative infinity, or positive infinity. In those three cases, it returns false.



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0 function _isFinite( n ) {
        if( ( n != n ) ||                       // property of NaN
                 n > Number.MAX_VALUE ||        // POS_INF
                 n < Number.MIN_VALUE ) {       // NEG_INF
                return false;
        } else {
                return true;
        }
}
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

Item

Areas Affected:
JScript 3.0 Function - Dictionary Object



Background Information:
Sets or returns an item for a specified key in a Dictionary object. For collections, returns an item based on the specified key. Read/write. If key is not found when changing an item, a new key is created with the specified newitem. If key is not found when attempting to return an existing item, a new key is created and its corresponding item is left empty.


Workaround:
 
Javascript 1.2 Using the Array object, you could mimic the general functionality of the dictionary object. 

function add(arrayIn, addElement, value) 

  eval("arrayIn[\"" + addElement + "\"] = value"); 

function exists(arrayIn, element) 

   for(i = 0; i < arrayIn.length; i++) 
   { 
     if(eval("arrayIn[\"" + element + "\"]") != null) 
         return true; 
   } 
   return false; 

function item(arrayIn, keyword, newValue) 

    if(exists(arrayIn, keyword)) 
       arrayIn[keyword] = newValue; 
   else 
       add(arrayIn, keyword, newValue); 

 

Javascript 1.1 See JavaScript 1.2 entry.
Javascript 1.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

setFullYear

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
Sets the year value in the Date object according to local time.



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0
// d is the date object
function setFullYear( d, year, month, numDate ) {
        if( typeof( year ) == "number" ) {
                var newYear = new Date( year, 0, 1 );
                var oldYear = new Date( getFullYear( d ), 0, 1 );
                d.setTime( d.getTime() + newYear.getTime() 
                        - oldYear.getTime() );

                if( typeof( month ) == "number" ) {
                        date.setMonth( month );
                }
                if( typeof( numDate ) == "number" ) {
                        date.setDate( numDate );
                }
        }
        return date;
}
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

setMilliseconds

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
Modifies the milliseconds value stored in the Date object according to local time.



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0
//d is the date object, nMilliseconds is the number of milliseconds
function setMilliseconds( d, nMilliseconds ) {
        if( nMilliseconds >= 1000 || nMilliseconds < 0) {
                return null;
        }
        var date = new Date( d.getYear(), d.getMonth(), d.getDate(), 
                d.getHours(), d.getMinutes(), d.getSeconds() );
        d.setTime( date.getTime() + nMilliseconds );
        return date;
}
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

setUTCDate

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
Sets the numeric date of the Date object in Universal Coordinated Time (UTC). To set the date according to local time, use the setDate method.
If the value of numDate is greater than the number of days in the month stored in the Date object or is a negative number, the date is set to a date equal to numDate minus the number of days in the stored month. For example, if the stored date is January 5, 1996, and setUTCDate(32) is called, the date changes to February 1, 1996. Negative numbers have a similar behavior.

Example:

function SetUTCDateDemo(newdate)
{
  var d, s;
  d = new Date();
  d.setUTCDate(newdate);
  s = "Current setting is ";
  s += d.toUTCString();
  return(s);
}



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0
function setUTCDate( date, numDate ) {
        setUTCFullYear( date, null, null, numDate );
        return date;
}
function setUTCFullYear( date, year, month, numDate ) {
        var nTimezoneOffset = date.getTimezoneOffset() * 60 * 1000;

        date.setTime( date.getTime() + nTimezoneOffset );
        if( typeof( year ) == "number" ) {
                setFullYear( date, year );
        }
        if( typeof( month ) == "number" ) {
                date.setMonth( month );
        }
        if( typeof( numDate ) == "number" ) {
                date.setDate( numDate );
        }
        var a = date.getTime() - nTimezoneOffset;
        date.setTime( a );
        return date;
}
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

setUTCFullYear

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
Sets the year value in the Date object according to Universal Coordinated Time (UTC).


Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0
function setUTCFullYear( date, year, month, numDate ) {
        var nTimezoneOffset = date.getTimezoneOffset() * 60 * 1000;

        date.setTime( date.getTime() + nTimezoneOffset );
        if( typeof( year ) == "number" ) {
                setFullYear( date, year );
        }
        if( typeof( month ) == "number" ) {
                date.setMonth( month );
        }
        if( typeof( numDate ) == "number" ) {
                date.setDate( numDate );
        }
        var a = date.getTime() - nTimezoneOffset;
        date.setTime( a );
        return date;
}
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

setUTCHours

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
Modifies the hours stored in the Date object according to Universal Coordinated Time (UTC). All set methods taking optional arguments use the value returned from corresponding get methods, if you do not specify an optional argument. For example, if the numMonth argument is optional, but not specified, JScript uses the value returned from the getMonth method.

If the value of an argument is greater than its range or is a negative number, other stored values are modified accordingly. For example, if the stored date is "Jan 5, 1996 00:00:00.00", and setUTCHours(30) is called, the date is changed to "Jan 6, 1996 06:00:00.00."



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0
function setUTCHours( date, hours, mins, secs, msecs ) {
        nTimezoneOffset = date.getTimezoneOffset() * 60 * 1000;
        date.setTime( date.getTime() + nTimezoneOffset );
        if( typeof( hours ) == "number" ) {
                date.setHours( hours );
        }
        if( typeof( mins ) == "number" ) {
                date.setMinutes( mins );
        }
        if( typeof( secs ) == "number" ) {
                date.setSeconds( secs );
        }
        if( typeof( msecs ) == "number" ) {
                setMilliseconds( date, msecs );
        }
        date.setTime( date.getTime() - nTimezoneOffset );
        return date;
}
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

setUTCMilliseconds

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
Modifies the milliseconds value stored in the Date object according to Universal Coordinated Time (UTC). To set the milliseconds according to local time, use the setMilliseconds method.

If the value of numMilli is greater than 999 or is a negative number, the stored number of seconds (and minutes, hours, and so forth, if necessary) is incremented an appropriate amount.



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0
function setUTCMilliseconds( date, msecs ) {
        setUTCHours( date, null, null, null, msecs );
        return date;
}
function setUTCHours( date, hours, mins, secs, msecs ) {
        nTimezoneOffset = date.getTimezoneOffset() * 60 * 1000;
        date.setTime( date.getTime() + nTimezoneOffset );
        if( typeof( hours ) == "number" ) {
                date.setHours( hours );
        }
        if( typeof( mins ) == "number" ) {
                date.setMinutes( mins );
        }
        if( typeof( secs ) == "number" ) {
                date.setSeconds( secs );
        }
        if( typeof( msecs ) == "number" ) {
                setMilliseconds( date, msecs );
        }
        date.setTime( date.getTime() - nTimezoneOffset );
        return date;
}
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

setUTCMinutes

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
Modifies the minutes value of the Date object according to Universal Coordinated Time (UTC).



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0
function setUTCMinutes( date, mins, secs, msecs ) {
        setUTCHours( date, null, min, secs, msecs  );
        return date;
}
function setUTCHours( date, hours, mins, secs, msecs ) {
        nTimezoneOffset = date.getTimezoneOffset() * 60 * 1000;
        date.setTime( date.getTime() + nTimezoneOffset );
        if( typeof( hours ) == "number" ) {
                date.setHours( hours );
        }
        if( typeof( mins ) == "number" ) {
                date.setMinutes( mins );
        }
        if( typeof( secs ) == "number" ) {
                date.setSeconds( secs );
        }
        if( typeof( msecs ) == "number" ) {
                setMilliseconds( date, msecs );
        }
        date.setTime( date.getTime() - nTimezoneOffset );
        return date;
}
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

setUTCMonth

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
Modifies the month stored in the Date object according to Universal Coordinated Time (UTC).



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0
function setUTCMonth( date, month, numDate ) {
        setUTCFullYear( date, null, month, numDate );
        return date;
}
function setUTCFullYear( date, year, month, numDate ) {
        var nTimezoneOffset = date.getTimezoneOffset() * 60 * 1000;

        date.setTime( date.getTime() + nTimezoneOffset );
        if( typeof( year ) == "number" ) {
                setFullYear( date, year );
        }
        if( typeof( month ) == "number" ) {
                date.setMonth( month );
        }
        if( typeof( numDate ) == "number" ) {
                date.setDate( numDate );
        }
        var a = date.getTime() - nTimezoneOffset;
        date.setTime( a );
        return date;
}
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

setUTCSeconds

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
Modifies the seconds value stored in the Date object according to Universal Coordinated Time (UTC).All set methods taking optional arguments use the value returned from corresponding get methods, if you do not specify an optional argument. For example, if the numMonth argument is optional, but not specified, JScript uses the value returned from the getMonth method.

If the value of an argument is greater than its range or is a negative number, other stored values are modified accordingly. For example, if the stored date is "Jan 5, 1996 00:00:00.00" and setSeconds(150) is called, the date is changed to "Jan 5, 1996 00:02:30.00."



Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0
function setUTCSeconds( date, secs, msecs ) {
        setUTCHours( date, null, null, secs, msecs );
        return date;
}
function setUTCHours( date, hours, mins, secs, msecs ) {
        nTimezoneOffset = date.getTimezoneOffset() * 60 * 1000;
        date.setTime( date.getTime() + nTimezoneOffset );
        if( typeof( hours ) == "number" ) {
                date.setHours( hours );
        }
        if( typeof( mins ) == "number" ) {
                date.setMinutes( mins );
        }
        if( typeof( secs ) == "number" ) {
                date.setSeconds( secs );
        }
        if( typeof( msecs ) == "number" ) {
                setMilliseconds( date, msecs );
        }
        date.setTime( date.getTime() - nTimezoneOffset );
        return date;
}
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

toUTCString

Areas Affected:
JScript 3.0 Function - Date Object



Background Information:
Converts the date to a string in Universal Coordinated Time (UTC).



Workaround:
 
Javascript 1.2 No Workaround exists
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

Drive, Enumerator, File, Folder, Global, Object, VBArray, Attributes, AvailableSpace, DateCreated, DateLastAccessed, DateLastModified, Drive, DriveLetter, Drives, DriveType, Files, FileSystem, FreeSpace, global, ignoreCase, index, input, IsReady, IsRootFolder, Name, ParentFolder, Path, RootFolder, SerialNumber, ShareName, ShortName, ShortPath, Size, SubFolders, TotalSize, Type, VolumeName, Add, atEnd, BuildPath, Copy, CopyFile, CopyFolder, CreateFolder, Delete, DeleteFile, DeleteFolder, DriveExists, FileExists, FolderExists, GetAbsolutePathName, GetBaseName, GetDrive, GetDriveName, GetExtensionName, GetFile, GetFileName, GetFolder, GetParentFolderName, GetSpecialFolder, GetTempName, Move, MoveFile, moveFirst, MoveFolder, moveNext, OpenAsTextStream

Areas Affected:
Drive Object, Drives Object, Enumerator Object, File Object, Files Object, FileSystemObject Object, Folder Object, Folders Object, TextStream Object



Background Information:
These objects have been grouped together. All of these objects deal with direct file access which is not supported in JavaScript at all, or provide services at an object level which can not be provided in JavaScript. JavaScript 1.3 will provide functionality simliar to JScript 3.0.



Workaround:
 
Javascript 1.2 No Workaround exists
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

slice

Areas Affected:
JScript 3.0 Function - String Object



Background Information:



Workaround:
 
Javascript 1.2 Slice is part of the String object and has identical functionality as that in JScript 3.0
Javascript 1.1 function myStringSlice( str1, begin, end ) { 

        // check number of arguments passed into the function 
        if( myStringSlice.arguments.length < 2 ) { 
                return null; 
        } else if( myStringSlice.arguments.length == 2 ) { 
                end = str1.length; 
        } 

        // deal with negative and large values of 'begin' and 'end' 
        if( end < 0 ) { 
                end = str1.length + end; 
        } else if( end > str1.length ) { 
                end = str1.length; 
        } 
        begin = ( begin < 0 ) ? 0 : begin; 

        // assert data passed in are valid 
        if( str1.length == 0 ||         // empty String 
                 begin >= str1.length ||// invalid begin index 
                 end <= begin ||     // invalid end index 
                 end == 0               // invalid end index 
        ) { 
                return null; 
        } 

        str2 = ""; 
        for( i = begin, j = 0; i < end; i++, j++ ) { 
                str2 += str1.charAt( i ); 
        } 
        return str2; 
}

Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents

substr

Areas Affected:
JScript 3.0 Function - String Object



Background Information:
Returns a substring beginning at a specified location and having a specified length.



Workaround:
 
Javascript 1.2 String Object has an identical object model in the JavaScript 1.2 API
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

GetObject

Areas Affected:
JScript 3.0 Function - General Object



Background Information:
Use the GetObject function to access an Automation object from a file. Assign the object returned by GetObject to the object variable.

Example:
var CADObject;
CADObject = GetObject("C:\\CAD\\SCHEMA.CAD");

When this code is executed, the application associated with the specified pathname is started, and the object in the specified file is activated. If pathname is a zero-length string (""), GetObject returns a new object instance of the specified type. If the pathname argument is omitted, GetObject returns a currently active object of the specified type. If no object of the specified type exists, an error occurs.

Some applications allow you to activate part of a file. Add an exclamation point (!) to the end of the file name and follow it with a string that identifies the part of the file you want to activate. For information on how to create this string, see the documentation for the application that created the object.



Workaround:
 
Javascript 1.2 No Workaround exists
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

@cc_on

Areas Affected:
JScript 3.0 Function - General Function



Background Information:
The @cc_on statement activates conditional compilation in the scripting engine.
It is strongly recommended that you use the @cc_on statement in a comment, so that browsers that do not support conditional compilation will accept your script as valid syntax:

/*@cc_on*/
...
(remainder of script)

Alternatively, an @if or @set statement outside of a comment also activates conditional compilation.



Workaround:
 
Javascript 1.2 No Workaround exists
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

@if

Areas Affected:
JScript 3.0 Function - General Function



Background Information:
Conditionally executes a group of statements, depending on the value of an expression.

Syntax
@if (condition1)
     text1
[@elif (condition2)
     text2]
[@else
     text3]
@end

When you write an @if statement, you don't have to place each clause on a separate line. You can use multiple @elif clauses, however, all @elif clauses must come before an @else clause. You commonly use the @if statement to determine which text among several options should be used for text output.



Workaround:
 
Javascript 1.2 No Workaround exists
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

@set

Areas Affected:
JScript 3.0 Function - General Function



Background Information:
Numeric and Boolean variables are supported for conditional compilation. Strings are not. Variables created using @set are generally used in conditional compilation statements, but can be used anywhere in JScript code.


Workaround:
 
Javascript 1.2 No Workaround exists
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

Do

Areas Affected:
JScript 3.0 Function



Background Information:
Executes a statement block once, and then repeats execution of the loop until a condition expression evaluates to false.



Workaround:
 
Javascript 1.2 while (expr) { stmts; }
Javascript 1.1 while (expr) { stmts; }
Javascript 1.0 while (expr) { stmts; }
JScript 2.0 while (expr) { stmts; }
JScript 1.0 while (expr) { stmts; }
Table of Contents
 

Switch

Areas Affected:
JScript 3.0 Function



Background Information:
Enables the execution of one or more statements when a specified expression's value matches a label.



Workaround:
 
Javascript 1.2 Switch Part of the JavaScript 1.2 API
Javascript 1.1 Can format if...else statements to setup the ordered conditions.
Javascript 1.0 Can format if...else statements to setup the ordered conditions.
JScript 2.0 Can format if...else statements to setup the ordered conditions.
JScript 1.0 Can format if...else statements to setup the ordered conditions.
Table of Contents
 

===

Areas Affected:
JScript 3.0 Function



Background Information:
Identity (===. !==)
These operators behave identically to the equality operators except no type conversion is done, and the types must be the same to be considered equal.


Workaround:
 
Javascript 1.2 See JavaScript 1.0 entry
Javascript 1.1 See JavaScript 1.0 entry
Javascript 1.0
function areIdentical( obj1, obj2 ) {
        return ( ( obj1 == obj2 ) 
                && ( typeof( obj1 ) == typeof( obj2 ) ) );
}
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents
 

!==

Areas Affected:
JScript 3.0 Function



Background Information:
Identity (===. !==)
These operators behave identically to the equality operators except no type conversion is done, and the types must be the same to be considered equal.



Workaround:
 
Javascript 1.2 No Workaround exists
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
Table of Contents