| – allowing for functionality not possible in HTML alone. However, other web browsers such as Chrome, Firefox and Opera do not support VBScript. Therefore, when client-side scripting and cross-browser compatibility are required, developers usually choose JavaScript due to its wide cross-browser compatibility.
VBScript is used for server-side web page functionality via Active Server Pages (ASP). The ASP engine, <%OptionExplicit%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>VBScriptExample</title>
</head>
<body>
<div><%
' Grab current time from Now() function.
' An '=' sign occurring after a context switch (<%) is shorthand
' for a call to the Write() method of the Response object.
DimtimeValue:timeValue=Now%>
Thetime,in24-hourformat,is
<%=Hour(timeValue)%>:<%=Minute(timeValue)%>:<%=Second(timeValue)%>.
</div>
</body>
</html>
VBScript can run directly in the operating system via the Windows Script Host (WSH). A script file, usually with extension .vbs can be run either via wscript.exe or mshta.exe.
Windows Script Componentedit
VBScript can also be used in a Windows Script Component, an ActiveX-enabled script class that can be invoked by other COM-enabled applications. These files have extension False for logical values, MsgBox codes, vbCR for the carriage return character, and many others.
Variables have "Variant" type by default, but it is possible (and sometimes necessary) to force a particular type (integer, date, etc.) using conversion functions (msxml6.dll, - ↑ WSH Version Information, on MSDN
- ↑ VBScript Version Information, on MSDN
- ↑ What is VBScript?, in MSDN Library
- ↑ "Deprecated features in the Windows client - What's new in Windows". 7 November 2023.
- 1 2 "VBScript Features". msdn.microsoft.com. 24 October 2011.
- ↑ "VbsEdit - VBScript Editor with Debugger - VBS Editor". www.vbsedit.com.
- ↑ "Caché for Unstructured Data Analysis". InterSystems. Retrieved 2018-09-24.
Wikimedia Commons has media related to VBScript.
|