My Account Subscribe Help About
Sign In | Register FREE
Friday, April 10, 2026
Man jailed for killing abused wife who jumped from bridgeCeasefire or no ceasefire, the Middle East's reshuffling is not yet doneMelania Trump denies ties to Jeffrey Epstein and urges hearing for survivorsSimple guide: How the Iran war is affecting the cost of holidays, food and clothesEU fingerprint and photo travel rules come into forceWant to help garden birds? Don't feed them in warmer months, says RSPBDublin Airport issues travel guidance as Irish fuel protests continueMen behind 'Tripadvisor for people smugglers' jailed for 19 yearsIran conflict must be 'line in sand' to build more resilient UK, Starmer saysBafta fell short in duty of care when racial slur was shouted, review findsExtra £5m pledged for patrolling places of worship'Endless fears': Even if fighting stops, the damage to Iran's children will endureLebanon thought there was a ceasefire - then Israel unleashed deadly blitzHow many ships are crossing the Strait of Hormuz?Has US achieved its war objectives in Iran?Can stats help you find the Grand National winner?This coat cost $248 in illegal tariffs. Will he ever get the money back?From a smuggled harmonica to Artemis' playlist - the history of music in spaceWeekly quiz: What might have made Paddington panic about his marmalade?How the Artemis crew will splash down on EarthLeBron and Bronny James record first son-to-father assist in NBA historyTen cases a day - 'blitz courts' could tackle the Crown Court backlog'I was in a slump - now my art is in Billie Eilish's house'Labrinth not involved in Euphoria's third seasonLava soars into air as Hawaii's Kilauea volcano erupts againWhite House staff told not to place bets on prediction marketsRussia and Ukraine agree to truce for Orthodox EasterBBC News appIs Defence Secretary Pete Hegseth waging a holy war against Iran?Defence secretary interview on Russian submarine operation
FDN » ASP & VBScript » VBScript Language Reference

VBScript Language Reference

VBScript Language Reference

VBScript is the default scripting language for ASP and Windows Script Host (WSH). This reference covers the essential language features.

Variables and Constants

Option Explicit  ' Require variable declarations

Dim strName, intAge, blnActive
strName   = "John"
intAge    = 30
blnActive = True

Const MAX_RETRIES = 3
Const APP_NAME    = "Flamenet Portal"

Data Types

VBScript has a single data type: Variant. The variant subtype is determined by the value assigned:

SubtypeDescriptionExample
EmptyUninitialized variableDim x
NullNo valid datax = Null
StringCharacter string"Hello"
Integer-32,768 to 32,76742
Long-2B to 2B100000
BooleanTrue or FalseTrue
DateDate/time value#6/15/2001#
ObjectCOM object referenceSet obj = ...

Control Flow

' If...Then...Else
If intAge >= 18 Then
    WScript.Echo "Adult"
ElseIf intAge >= 13 Then
    WScript.Echo "Teenager"
Else
    WScript.Echo "Child"
End If

' Select Case
Select Case strRole
    Case "admin"
        WScript.Echo "Administrator"
    Case "mod"
        WScript.Echo "Moderator"
    Case Else
        WScript.Echo "Member"
End Select

' For...Next
For i = 1 To 10
    WScript.Echo i
Next

' For Each
Dim arr
arr = Array("apple", "banana", "cherry")
For Each item In arr
    WScript.Echo item
Next

' Do While
Do While Not rs.EOF
    WScript.Echo rs("Name")
    rs.MoveNext
Loop

String Functions

FunctionDescriptionExample
Len(s)String lengthLen("Hello") = 5
Left(s, n)Left n charactersLeft("Hello", 3) = "Hel"
Right(s, n)Right n charactersRight("Hello", 2) = "lo"
Mid(s, start, len)SubstringMid("Hello", 2, 3) = "ell"
InStr(s, find)Position of substringInStr("Hello", "ll") = 3
Replace(s, old, new)Replace textReplace("abc", "b", "x") = "axc"
UCase(s) / LCase(s)Case conversionUCase("hello") = "HELLO"
Trim(s)Remove spacesTrim(" hi ") = "hi"
Split(s, d)Split to arraySplit("a,b,c", ",") = Array
Join(arr, d)Join arrayJoin(arr, ",") = "a,b,c"
« Back to ASP & VBScript « Back to FDN