Skip to content

Latest commit

Β 

History

History
482 lines (407 loc) Β· 12.3 KB

File metadata and controls

482 lines (407 loc) Β· 12.3 KB

VBScript Engine Compatibility

This document tracks the compatibility between this VBScript engine implementation and Microsoft's Internet Explorer VBScript engine.

Status Legend:

  • βœ”οΈ Implemented - Feature is fully or partially implemented
  • ❌ Not Implemented - Feature is not yet implemented but may be in the future
  • β›” Intentionally Not Implemented - Feature will not be implemented due to platform limitations

Core Language Features

Data Types

Feature Status Notes
Empty βœ”οΈ
Null βœ”οΈ
Nothing βœ”οΈ
Boolean βœ”οΈ
Byte βœ”οΈ
Integer βœ”οΈ
Long βœ”οΈ
Single βœ”οΈ
Double βœ”οΈ
Currency βœ”οΈ
Date βœ”οΈ
String βœ”οΈ
Object βœ”οΈ
Variant βœ”οΈ
Error βœ”οΈ

Variables and Constants

Feature Status Notes
Dim βœ”οΈ
ReDim βœ”οΈ With Preserve support
Const βœ”οΈ
Public βœ”οΈ
Private βœ”οΈ
Option Explicit βœ”οΈ

Operators

Feature Status Notes
Arithmetic (+, -, *, /) βœ”οΈ
Integer Division () βœ”οΈ
Modulo (Mod) βœ”οΈ
Exponentiation (^) βœ”οΈ
Concatenation (&) βœ”οΈ
Comparison (=, <>, <, >, <=, >=) βœ”οΈ
Is βœ”οΈ
And βœ”οΈ
Or βœ”οΈ
Not βœ”οΈ
Xor βœ”οΈ
Eqv βœ”οΈ
Imp βœ”οΈ
Operator Precedence βœ”οΈ

Control Flow Statements

Feature Status Notes
If...Then...Else βœ”οΈ Single-line and multi-line
ElseIf βœ”οΈ
For...Next βœ”οΈ With Step support
For Each...Next βœ”οΈ
Do...Loop βœ”οΈ While/Until variants
While...Wend βœ”οΈ
Select Case βœ”οΈ With Case Else
Exit (Do/For/Sub/Function/Property) βœ”οΈ
With...End With βœ”οΈ
GoTo βœ”οΈ With label support
On Error βœ”οΈ Resume Next, GoTo 0
Resume βœ”οΈ Partial implementation

Procedures and Classes

Procedures

Feature Status Notes
Sub βœ”οΈ
Function βœ”οΈ
Call βœ”οΈ
ByVal βœ”οΈ
ByRef βœ”οΈ Default behavior
Optional Parameters βœ”οΈ With default values
ParamArray βœ”οΈ

Classes

Feature Status Notes
Class...End Class βœ”οΈ
New βœ”οΈ
Property Get βœ”οΈ
Property Let βœ”οΈ
Property Set βœ”οΈ
Me βœ”οΈ
Initialize Event βœ”οΈ Class_Initialize
Terminate Event βœ”οΈ Class_Terminate

Built-in Functions

String Functions

Function Status Notes
Len βœ”οΈ
Left βœ”οΈ
Right βœ”οΈ
Mid βœ”οΈ
InStr βœ”οΈ
InStrRev βœ”οΈ
LCase βœ”οΈ
UCase βœ”οΈ
LTrim βœ”οΈ
RTrim βœ”οΈ
Trim βœ”οΈ
Replace βœ”οΈ
StrReverse βœ”οΈ
Space βœ”οΈ
String βœ”οΈ Create repeated character string
Asc βœ”οΈ
AscW βœ”οΈ
Chr βœ”οΈ
ChrW βœ”οΈ
StrComp βœ”οΈ
Split βœ”οΈ
Join βœ”οΈ
Filter βœ”οΈ
Format βœ”οΈ Custom format strings
LSet βœ”οΈ
RSet βœ”οΈ

Mathematical Functions

Function Status Notes
Abs βœ”οΈ
Sgn βœ”οΈ
Sqr βœ”οΈ
Int βœ”οΈ
Fix βœ”οΈ
Round βœ”οΈ
Atn βœ”οΈ
Cos βœ”οΈ
Sin βœ”οΈ
Tan βœ”οΈ
Exp βœ”οΈ
Log βœ”οΈ Natural logarithm
Rnd βœ”οΈ
Randomize βœ”οΈ
Hex βœ”οΈ
Oct βœ”οΈ

Date and Time Functions

Function Status Notes
Now βœ”οΈ
Date βœ”οΈ
Time βœ”οΈ
Year βœ”οΈ
Month βœ”οΈ
Day βœ”οΈ
Weekday βœ”οΈ
Hour βœ”οΈ
Minute βœ”οΈ
Second βœ”οΈ
DateAdd βœ”οΈ
DateDiff βœ”οΈ
DatePart βœ”οΈ
DateSerial βœ”οΈ
TimeSerial βœ”οΈ
DateValue βœ”οΈ
TimeValue βœ”οΈ
MonthName βœ”οΈ
WeekdayName βœ”οΈ
Timer βœ”οΈ

Conversion Functions

Function Status Notes
CBool βœ”οΈ
CByte βœ”οΈ
CCur βœ”οΈ
CDate βœ”οΈ
CDbl βœ”οΈ
CInt βœ”οΈ
CLng βœ”οΈ
CSng βœ”οΈ
CStr βœ”οΈ
CVar βœ”οΈ
CVErr βœ”οΈ
Val βœ”οΈ
Str βœ”οΈ
FormatNumber βœ”οΈ Uses Intl API with locale support
FormatCurrency βœ”οΈ Auto-detects currency from locale
FormatPercent βœ”οΈ Uses Intl API with locale support
FormatDateTime βœ”οΈ Uses Intl API with locale support

Inspection Functions

Function Status Notes
IsArray βœ”οΈ
IsDate βœ”οΈ
IsEmpty βœ”οΈ
IsNull βœ”οΈ
IsNumeric βœ”οΈ
IsObject βœ”οΈ
VarType βœ”οΈ
TypeName βœ”οΈ

Array Functions

Function Status Notes
Array βœ”οΈ
LBound βœ”οΈ
UBound βœ”οΈ
Erase βœ”οΈ Full implementation for fixed-size arrays
Filter βœ”οΈ

Other Functions

Function Status Notes
Eval βœ”οΈ
Execute βœ”οΈ Dynamic code execution in current scope
ExecuteGlobal βœ”οΈ Dynamic code execution in global scope
MsgBox βœ”οΈ Browser simulation using alert/confirm
InputBox βœ”οΈ Browser simulation using prompt
GetRef βœ”οΈ
GetLocale βœ”οΈ Uses Intl API to detect browser locale
SetLocale βœ”οΈ Sets locale, returns LCID
CreateObject β›” COM objects unavailable in browser
GetObject β›” COM objects unavailable in browser
LoadPicture βœ”οΈ Returns stub IPictureDisp object
RGB βœ”οΈ Returns RGB color value
QBColor βœ”οΈ Returns legacy color value
ScriptEngine βœ”οΈ Returns "VBScript"
ScriptEngineMajorVersion βœ”οΈ Returns 10
ScriptEngineMinorVersion βœ”οΈ Returns 8
ScriptEngineBuildVersion βœ”οΈ Returns 16384

Objects

Err Object

Property/Method Status Notes
Number βœ”οΈ
Description βœ”οΈ
Source βœ”οΈ
Clear βœ”οΈ
Raise βœ”οΈ
HelpContext β›” Windows Help system
HelpFile β›” Windows Help system

RegExp Object

Feature Status Notes
RegExp Object βœ”οΈ
Pattern βœ”οΈ
Global βœ”οΈ
IgnoreCase βœ”οΈ
Multiline βœ”οΈ
Execute Method βœ”οΈ
Test Method βœ”οΈ
Replace Method βœ”οΈ
Match Object βœ”οΈ FirstIndex, Length, Value
Matches Collection βœ”οΈ Count, Item
SubMatches Collection βœ”οΈ

Class Object

Feature Status Notes
Class definition βœ”οΈ
Public members βœ”οΈ
Private members βœ”οΈ
Property procedures βœ”οΈ
Methods βœ”οΈ

VBArray Object (JavaScript-side)

VBArray is a JavaScript-side object for accessing VBScript arrays from JavaScript. It provides backward compatibility with early Internet Explorer, which required wrapping VBScript arrays before accessing them from JavaScript.

Feature Status Notes
VBArray constructor βœ”οΈ Wraps internal VbArray for JS access
dimensions() βœ”οΈ Returns number of dimensions
lbound() βœ”οΈ Returns lower bound of a dimension
ubound() βœ”οΈ Returns upper bound of a dimension
getItem() βœ”οΈ Gets value at specified indices
toArray() βœ”οΈ Converts to JavaScript array

Configuration: The injectVBArrayToGlobalThis option (default: true) controls whether VBArray is available as globalThis.VBArray. When enabled, legacy code using new VBArray(vbArray) will work. Modern code can access VBScript arrays directly without wrapping.


Statements

Statement Status Notes
Call βœ”οΈ
Class βœ”οΈ
Const βœ”οΈ
Dim βœ”οΈ
Do...Loop βœ”οΈ
Erase βœ”οΈ
Execute βœ”οΈ
ExecuteGlobal βœ”οΈ
Exit βœ”οΈ
For...Next βœ”οΈ
For Each...Next βœ”οΈ
Function βœ”οΈ
GoTo βœ”οΈ
If...Then...Else βœ”οΈ
On Error βœ”οΈ
Option Explicit βœ”οΈ
Private βœ”οΈ
Property Get/Let/Set βœ”οΈ
Public βœ”οΈ
Randomize βœ”οΈ
ReDim βœ”οΈ
Rem βœ”οΈ
Select Case βœ”οΈ
Set βœ”οΈ
Sub βœ”οΈ
While...Wend βœ”οΈ
With βœ”οΈ

Constants

String Constants

Constant Status Notes
vbCr βœ”οΈ
vbCrLf βœ”οΈ
vbFormFeed βœ”οΈ
vbLf βœ”οΈ
vbNewLine βœ”οΈ
vbNullChar βœ”οΈ
vbNullString βœ”οΈ
vbTab βœ”οΈ
vbVerticalTab βœ”οΈ

VarType Constants

Constant Status Notes
vbEmpty βœ”οΈ
vbNull βœ”οΈ
vbInteger βœ”οΈ
vbLong βœ”οΈ
vbSingle βœ”οΈ
vbDouble βœ”οΈ
vbCurrency βœ”οΈ
vbDate βœ”οΈ
vbString βœ”οΈ
vbObject βœ”οΈ
vbError βœ”οΈ
vbBoolean βœ”οΈ
vbVariant βœ”οΈ
vbByte βœ”οΈ
vbArray βœ”οΈ

MsgBox Constants

Constant Status Notes
vbOKOnly βœ”οΈ
vbOKCancel βœ”οΈ
vbAbortRetryIgnore βœ”οΈ
vbYesNoCancel βœ”οΈ
vbYesNo βœ”οΈ
vbRetryCancel βœ”οΈ
vbCritical βœ”οΈ
vbQuestion βœ”οΈ
vbExclamation βœ”οΈ
vbInformation βœ”οΈ
vbDefaultButton1/2/3 βœ”οΈ
vbOK βœ”οΈ
vbCancel βœ”οΈ
vbAbort βœ”οΈ
vbRetry βœ”οΈ
vbIgnore βœ”οΈ
vbYes βœ”οΈ
vbNo βœ”οΈ

Date Constants

Constant Status Notes
vbSunday - vbSaturday βœ”οΈ
vbUseSystemDayOfWeek βœ”οΈ
vbFirstJan1 βœ”οΈ
vbFirstFourDays βœ”οΈ
vbFirstFullWeek βœ”οΈ
vbGeneralDate βœ”οΈ
vbLongDate βœ”οΈ
vbShortDate βœ”οΈ
vbLongTime βœ”οΈ
vbShortTime βœ”οΈ

Comparison Constants

Constant Status Notes
vbBinaryCompare βœ”οΈ
vbTextCompare βœ”οΈ
vbDatabaseCompare βœ”οΈ Falls back to locale-aware comparison

Other Constants

Constant Status Notes
vbObjectError βœ”οΈ

COM Objects

All COM objects features are intentionally not implemented due to browser security restrictions.

These functions rely on the JavaScript environment's native ActiveXObject support. In Internet Explorer, this allows creating COM objects including FileSystemObject, Word.Application, Excel.Application, etc. However, modern JavaScript environments (Chrome, Firefox, Edge, Node.js) do not support ActiveXObject. The author of this project may create a separate project in the future to implement polyfills for common COM objects (such as FileSystemObject, WScript.Shell, etc.) in modern JavaScript environments. This is beyond the scope of this VBScript engine project.

Feature Status Notes
FileSystemObject β›” Browser security
Drive Object β›” Browser security
Folder Object β›” Browser security
File Object β›” Browser security
TextStream β›” Browser security
Dictionary Object β›” Browser security

Events

Event Status Notes
Initialize βœ”οΈ Class_Initialize
Terminate βœ”οΈ Class_Terminate

Keywords

Keyword Status Notes
Empty βœ”οΈ
False βœ”οΈ
Nothing βœ”οΈ
Null βœ”οΈ
True βœ”οΈ
Me βœ”οΈ