Name

ScriptEngine Property

Class

Microsoft.VisualBasic.Globals

Syntax

ScriptEngine

Return Value

A String containing the value “VB”

Description

Indicates the programming language currently in use

Rules at a Glance

ScriptEngine is a read-only property.

Programming Tips and Gotchas

  • A number of scripting engines support a ScriptEngine property or function, which allows you to determine the programming language used for a particular block of code. These languages, and the strings they return, are shown in the following table:

Language

String

Microsoft Jscript

JScript

VB.NET

VB

VBScript

VBScript

  • The ScriptEngine property can be most useful when calling legacy code. On the .NET platform, the need to know the current scripting engine is substantially lessened by the existence of a unified type system.

VB.NET/VB 6 Differences

The property is new to VB.NET and is not supported in VB 6.

Get VB.NET Language in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.