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
ScriptEnginefunction, 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
ScriptEnginefunction 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.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access