Basic Syntax in VBScript
Basic VBScript Syntax
Remember below points about VBScript Syntax.
Remember below points about VBScript Syntax.
- VBScript is loosely typed language that means you do not need to declare the variables with data type
- VBScript comments start with symbol '. You can also comment using rem keyword.
- You do not need to put semicolon at the end of the statement like C,C++ and JAVA
- IsArray - This function can be used to check if the given variable is an array or not
- IsDate - This function can be used to check if the given variable is a valid date or not
- IsEmpty - This function can be used to check if the given variable is empty or not
- IsNull - This function can be used to check if the given variable is a null or not
- IsNumeric - This function can be used to check if the given variable is valid number or not
- IsObject - This function can be used to check if the given variable is valid object or not
- TypeName - This function returns the data type of the given variable.
Examples -
dim a(4) dim b b=10 Msgbox "a is array? -> " & IsArray(a) 'prints true Msgbox "b is a date? -> " & IsDate(a) 'prints false Msgbox "b is empty? -> " & IsEmpty(b) 'prints false Msgbox "b is null? -> " & IsNull(b) 'prints false Msgbox "b is numeric? -> " & IsNumeric(b) 'prints true Msgbox "b is object? -> " & IsObject(b) 'prints false Msgbox "TypeName of b -> " & TypeName(b) 'prints inte
0 comments:
Post a Comment