VBScript reference
From StealthBot Wiki
This is a quick reference for the language for keywords and built-in methods [1].
Contents |
Methods
- Main article: List of VBScript functions
Here are all available built-in VBScript functions:
- Date and time methods
- CDate(Value)
- Date()
- DateAdd(Interval, Number, Date)
- DateDiff(Interval, Date1, Date2, optional FirstDayOfWeek, optional FirstWeekOfYear)
- DatePart(Interval, Date, optional FirstDayOfWeek, optional FirstWeekOfYear)
- DateSerial(Year, Month, Day)
- DateValue(Date)
- Day(Date)
- FormatDateTime(Date, Format)
- Hour(Time)
- IsDate(Date)
- Minute(Time)
- Month(Date)
- MonthName(Month, optional Abbreviate)
- Now()
- Second(Time)
- Time()
- Timer()
- TimeSerial(Hour, Minute, Second)
- TimeValue(Time)
- Weekday(Date, optional FirstDayOfWeek)
- IsDate(Weekday, optional Abbreviate, optional FirstDayOfWeek)
- Year(Date)
- Format methods
- FormatCurrency(Number, optional DigitsAfterDecimal, optional IncludeLeadingZero, optional UseParenthesesForNegative, optional GroupDigits)
- FormatDateTime(Date, Format)
- FormatNumber(Number, optional DigitsAfterDecimal, optional IncludeLeadingZero, optional UseParenthesesForNegative, optional GroupDigits)includeleadingzero, optional useparenthesesfornegative, optional groupdigits)
- FormatPercent(Number, optional DigitsAfterDecimal, optional IncludeLeadingZero, optional UseParenthesesForNegative, optional GroupDigits)
- String methods
- InStr(optional Start, String1, String2, optional CompareMode)
- InStrRev(String1, String2, optional Start, optional CompareMode)
- LCase(Str)
- Left(Str, Length)
- Len(Str)
- LTrim(Str)
- Mid(Str, Start, optional Length)
- Replace(Str, Find, ReplaceWith, optional Start, optional Count, optional CompareMode)
- Right(Str, Length)
- RTrim(Str)
- Space(Number)
- StrComp(Str1, Str2, optional CompareMode)
- String(Number, Character)
- StrReverse(Str)
- Trim(Str)
- UCase(Str)
- Other methods
- CreateObject("Project.Object", optional Location)
- GetObject(optional Path, optional Class)
- GetRef(FunctionName)
- Eval(Expression)
- Execute Expression
- ExecuteGlobal Expression
- ScriptEngine()
- ScriptEngineMajorVersion()
- ScriptEngineMinorVersion()
- ScriptEngineBuildVersion()
- LoadPicture(Path)
- RGB(Red, Green, Blue)
- InputBox(Text, optional Title, optional Default, optional XPos, optional YPos, optional Helpfile, optional Context)
- MsgBox(Text, optional Flags, optional Title, optional Helpfile, optional Context)
- GetLocale()
- SetLocale(Lcid)
Constants
- Main article: List of VBScript constants
Here are all the categories of VBScript constants:
- Color constants
- Compare mode settings
- Date format settings
- Date intervals
- First day of week settings
- First week of year settings
- Message box results
- Message box settings
- String constants
- Variable types
- Other constant values
Keywords
Here is a list of all available VBScript keywords in alphabetical order and a link to the article about them.
-
And- Logical or bitwise conjunction -
ByVal- By value -
ByRef- By reference -
Call- Calling subroutines and functions -
Case-Select Caseblock andCaseblock -
Class- Class block -
Default- Default member -
Dim- Declaring variables -
Do-Doloop -
Each-For Eachblock -
Else-Elsestatement -
ElseIf-ElseIf...Thenstatement -
Empty- An uninitialized value -
End- End anIf,Select,Sub,Function,Property,Class, orWithblock -
Eqv- Logical or bitwise equivalence -
Error-On Error Resume Nextstatement orOn Error GoTo 0statement -
Exit- Exit aFor,Do,Sub,Function, orPropertyblock -
Explicit-Option Explicitstatement -
False- A negative Boolean -
For-Forloop -
Function-Functionblock -
Get-Property Getblock -
GoTo-On Error GoTo 0statement -
If-If...Thenstatement or block -
Imp- Logical or bitwise implication -
In-For Eachblock -
Is-Isoperator -
Let-Property Letblock -
Loop- End ofDoloop -
Mod- Modulus -
New- Creating custom objects -
Next- End ofForloop orOn Error Resume Nextstatement -
Not- Logical or bitwise negation -
Nothing- Cleaning up withNothing -
Null- A value with no data -
On-On Error Resume Nextstatement orOn Error GoTo 0statement -
Option-Option Explicitstatement -
Or- Logical or bitwise disjunction -
ReDim- Dynamic arrays -
Rem- Comments -
Resume-On Error Resume Nextstatement -
Preserve- Dynamic arrays -
Private- Declaring private variables or declaring private methods -
Property-Propertyblocks -
Public- Declaring public variables or declaring public methods -
Select-Select Caseblock -
Set-Property Setblock or Object assignment -
Step-Forblock -
Sub-Subblock -
Then-If...Thenstatement or block orElseIf...Thenstatement -
To-Forblock -
True- A positive Boolean -
Until-Doloop -
Wend- End aWhileloop -
While-Whileloop orDoloop -
With-Withblock -
Xor- Logical or bitwise exclusion - Object
.Member operator - Accessing object members -
+- Addition, string concatenation, or unary plus -
'- Comments -
/- Division (decimal) -
\- Division (integer) -
=- Equals comparison -
^- Exponent -
>- Greater than comparison -
>=- Greater than or equal to comparison -
<- Less than comparison -
<=- Less than or equal to comparison -
:- Line combination -
_- Line split -
*- Multiplication -
<>- Not equal comparison -
(...)- Parentheses -
[...]- Square bracketed identifiers -
&- String concatenation -
-- Subtraction or unary negation

