Name

ScriptEngine Function

Class

Microsoft.VisualBasic.Globals

Syntax

ScriptEngine(  )

Return Value

A String containing the value “VB”

Description

Indicates the programming language currently in use

Programming Tips and Gotchas

  • A number of scripting engines support the ScriptEngine 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 function 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 function is new to VB .NET and is not supported in VB 6.

Get VB .NET Language in a Nutshell 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.