Explain VBScript in detail?
This is a scripting language developed by Microsoft and is based loosely on Visual Basic. Its functionality in a web environment is dependent upon either an ASP engine or the Windows Scripting Host and must be used on a Windows hosting platform.
What are string functions in VBScript?
- Asc() – Returns ANSI Character Code
- Chr() – Returns Character from ANSI Code
- InStr() – Find a string within another
- InStrRev() – Find a string within another (Reverse)
- LCase() – Convert a string to lowercase
- Left() – Crops a string from left
- Len() – Determine the length of a string
- LTrim() – Remove leading spaces from a string
- Mid() – Crops a string
- Replace() – Replace a substring within a string
- Right() – Crops a string from right
- RTrim() – Remove trailing spaces from a string
- Space() – Creates a string with the specified number of spaces
- StrComp() – Compare two strings
- String() – Creates a repeated character string
- StrReverse() – Reverse the characters of a string
- Trim() – Remove both leading and trailing spaces from a string
- UCase() – Convert a string to uppercase
- Explain few date functions in VBScript
- Date(), Time(), Now(), Left(), Right(), & Mid()
What is event handling?
The actions that are performed by clicking, pressing keys, moving mouse, dragging and dropping etc are called as events. Event handling is the way to capture these events and perform the actions accordingly.
How you define option explicit in Vbscript?
If you want to use Option Explicit in VBScript you should have to declare all variables using the Dim, Private, Public, or ReDim statements.
Using Option Explicit to avoid incorrect typing the name of an existing variable or to avoid confusion in code where the scope of the variable is undefined.
Can you pass optional arguments to function in Vbscript?
Yes, We can pass optional argument to VBScript functions.We can use optional argument in VBScript by specifying optional keyword.
What is hta extension?
.hta extension is used whenever you want to include a VB script in HTML. Here HTML acts as an interface and VB Script as the programming language. .hta extension files do run in the safe and trusted zone of Internet explorer. Although they run in the trusted zone querying is restricted as it has to pass the guidelines of internet explorer.
How is variable declared in VbScript?
Using Dim Statement
Example
Dim Value
What is Variant data type in VbScript?
VBScript has only one data type called a Variant. A Variant is a special kind of data type that can contain different kinds of information, depending on how it’s used. Because Variant is the only data type in VBScript, it’s also the data type returned by all functions in VBScript.
How you define parametarization in VbScript?
Parametrization is useful when we want to change object’s parameters in accordance with a mathematical rule, or data from a file.
We can say that Parametrization is the best way to protect your database from SQL injection attacks
What is the difference between Dim, Public and Private statements?
Private statement variables are available only to the script in which they are declared.
Public statement variables are available to all procedures in all scripts.
Variables declared with Dim at the script level are available to all procedures within the script. At the procedure level, variables are available only within the procedure.
What are varient?
VbScript deals with a single datatype called variant. Datatype means the kind of the data a variable will store.It can be a character data,string data,number data , byte data and a Boolean data. But you don?t have to worry in Vb Script as it only has a datatype of variant to store any type of data.
Explain about SCRRUN.DLL?
Scripting Runtime library is very important for the functioning of Visual basic script because it gives much more functionality such as File management, text operations and file modification features. Scrrun.dll is used very much in programming VB.
Give me examples where Vb Script can directly run on users system with windows as os?
A simple example detailing the running of VB Script is by utilizing Windows Script host environment. Visual basic is a standalone application which has a .vbs as extension. Input can be provided through graphical user interface and output can be obtained by Wscript.exe from dialog and input boxes. From command line it can be invoked by Cscript.exe.
What is event handling in Vbscript?
The actions that are performed by clicking, pressing keys, moving mouse, dragging and dropping etc are called as events. Event handling is the way to capture these events and perform the actions accordingly.
Explain about operator precedence in VBScript?
In operator precedence expressions are evaluated and resolved in a predetermined order. The order of evaluation can be modulated if you use parenthesis. Expressions present in parenthesis are evaluated first.
Explain about .wsf files?
.wsf files are modeled in similar to XML. They can be executed with the help of Wscript.exe and it can be done from the command line also. This .wsf file can have multiple visual basic files. Reuse functionality is present with this extension file.
Explain about the extension .hta?
.hta extension is used whenever you want to include a VB script in HTML. Here HTML acts as an interface and VB Script as the programming language. .hta extension files do run in the safe and trusted zone of Internet explorer. Although they run in the trusted zone querying is restricted as it has to pass the guidelines of internet explorer.
Explain few date functions in VBScript
Date(), Time(), Now(), Left(), Right(), & Mid()
Explain about Tristate constants in VBScript?
Tristate constants can be used with functions which allow formatting of numbers. These constants can be used with VB Script without defining them. It can be used anywhere in the code to reflect and represent the values.
Explain about the functionality of VBScript?
Active X technology can be used to give much more functionality to VB Script. VB provides sub routines, functions, string manipulation, data/time, error handling, etc. VB can have more functionality added to it by working with languages such as ASP.
Explain about arrays in VB Script?
Arrays in VB Script should be assigned within the variant separated by a comma. If arguments are not specified then the string is regarded as empty. After specifying the elements in an array an index number should be used indicating the desired element.
Explain about scrrun.dll?
Scripting Runtime library is very important for the functioning of Visual basic script because it gives much more functionality such as File management, text operations and file modification features. Scrrun.dll is used very much in programming VB.
Explain about ADODB.Stream class?
ADODB.Stream class can be used as string builder. VBScript string concatenation can be very costly because of frequent memory allocation features. Binary file and memory I/O operation is provided by ADODB.Stream class. This is widely used to convert bytes into string, etc.
Â