R4R
Right Place For Right Person TM
 
R4R VBScript FAQS VBScript Subjective Questions and Answers

 


Tolal:29 Click: 1 2
Previous Home Next

VBSCRIPT Interview Questions And Answers

Page 1

Ques: 1 Can we pass optional argument to function in VBScript?

Ans:
Yes, We can pass optional argument to VBScript functions.We can use optional argument in VBScript by specifying optional keyword.

Ques: 2 How you define parametrization in VBScript?

Ans:
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.

Ques: 3 Define subtypes of data that a Variant data type in VBScript?

Ans:
Subtypes of data that a Variant data type in VBScript are given below: Byte - Between 0 to 255 String - Character strings Integer - Between -32,768 and 32,767 Long - Between (-2,147,483,648 and 2,147,483,647) Double - Extremely large numbers with decimal points Empty - The value that a variant holds before being used Error - An error number Null - No valid data Single - Large numbers with decimal points Currency- Monetary values Date - Date and time Object - Objects Boolean - True and False

Ques: 4 How you define Option Explicit in VBScript?

Ans:
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.

Ques: 5 How Sub Procedures and Function Procedures are differ in VBScript?

Ans:
VBScript support two types of procedures. These are Sub Procedures and Function Procedures The main difference b/w Sub Procedures and Function Procedures are given below: 1.In case of Sub Procedures we write series of VBScript statements inside the Sub and End Sub statement Where as in Function Procedures we write series of VBScript statements inside the Function and End. 2.Sub Procedures does not return any value where as Function Procedures return a value. 3.Procedures has two build-in VB Script functions these are MsgBox and InputBox. Example: If you want to done calculation.Than Using Sub Procedures we can displays the results of a calculation based on that information. Sub ConvertTemp() temp = InputBox("Enter temperature in degrees F.", 1) MsgBox "Temperature is " & Celsius(temp) & " degrees C." End Sub And Using function procedure we performed the calculation using VBScript. Function Celsius(fDegrees) Celsius = (fDegrees - 32) * 5 / 9 End Function

Ques: 6 Define Tristate constants in VB Script?

Ans:
We can allow formatting of numbers by using Tristate constants with functions. Tristate functions are used to reflect and represent the values any where in the code.Without defining Tristate constant it can be used with Vb Script.

Ques: 7 How you define ADODB.Stream class?

Ans:
We can use ADODB.Stream class as string builder. Because using VBScript string concatenation we can frequent memory allocation features.So,It is very costly.ADODB.Stream class provide us Binary file and memory I/O operation.Using this we can convert bytes into string etc.

Ques: 8 How we use scrrun.dll in JavaScript?

Ans:
scrrun.dll(Scripting Runtime library) is an important library which is used for the functioning of Visual basic script.We can improve some functionality like that File management, text operations and file modification features.

Ques: 9 Explain the functionality of VB Script?

Ans:
Using Active X technology we give much more functionality to VB Script.VB provide us sub routines, functions, string manipulation, data/time , error handling etc. We can increase the functionality of VB by using language like that ASP.

Ques: 10 Define some use of VB Script?

Ans:
As per functionality we can say that VB Script acts same to Java Script.But VB Script is only compatible with internet explorer. VB Script act with Document object model.We can use Visual basic script used for server side processing with ASP.

Ques: 11 Can VBScript can directly run on users system with Windows as OS?

Ans:
Yes, VBScript can directly run on users system with Windows as OS.I explain with an example The running of VB Script is by utilizing Windows Script Host environment.In this input enter through GUI(Graphical User Interface) and output receives from Wscript.exe .It can be raised by Cscript.exe from command line.

Ques: 12 What type of loops used in VBScript?

Ans:
When you want to execute same blocks of code a perticular number of times than we use looping. VBScript provide us four types of looping statements these are: 1.For..Next statement 2.For Each..Next statement 3.Do..Loop statement 4.While..Wend statement 1.For..Next statement: When you already know about no of repetitions than you used For..Next statement. Example: For i=1 to 5 Write some code here Next Above program will display output till value of i is 1,2,3,4,5, We use 'Step' keyword you want to increase or decrease the value of variable. Below,When loop repeated it increase the value of three steps each time. Example: For i=3 To 15 Step 3 Write some code here Next Below,When loop repeated it decrease the value of two steps each time. Example: For i=15 To 3 Step -3 Write some code here Next If you want to exit For..next statement than we have to use Exit For Keyword. 2.For Each..Next statement: Using this we can execute a block of code for each element of an array. Example: dim friends(3) friends(0)="Tom" friends(1)="Jack" friends(2)="Sam" friends(3)="Robert" For Each i in friends document.write(i & "<br />") Next 3.Do..Loop statement: We use this loop when we don't how many times loop will executed.And repeat the block of code till is true.Loop will executed atleast one time whenever condition is true or false. Example: Do While i>14 Write some code here Loop If value of i is less than 14 loop doesn't executed. Do Write some code here Loop While i>14 Above,loop will executed atleast one time whenever condition is false(when value of i is less than 14.And it will repeated codes till condition is true. Until Keyword: Using Until,we can check the condition if it is true than code will not executed. Example: Do Until i=5 Write some code here Loop It will executed until the value of i is 5. Example: Do Write some code here Loop Until i=5 It will execute code atleast one time.And further execute until the condition is true(i=5). We can exit from do..loop statement after using Do exit keyword. Example: Do Until i=5 i=i-1 If i<5 Then Exit Do Loop Above, loop is executed when i is different from 5 till it greater than 5. 4.While..Wend statement: We not use this or else use it do..loop statement.

Ques: 13 What conditional statement we used in VBScript?

Ans:
Conditional statements that we used in VBScript are given below: 1.if statement 2.if..than..else statement 3.if..than..elseif statement 4.select case statement 1.if statement: In if statement we execute a statement when some condition is true. Example: if i=8 Then msgbox "Welcome". This code will execute only one time. 2.if..then..else statement: Used when we want to execute more than one statement when some condition is true. Example: if i=8 Then msgbox "Welcome" i = i+1 end If In the above code we can execute multiple statements when conditon is ture or using else can execute statement the condition is false.Like that, if i=8 then msgbox "Welcome" else msgbox "Wait" end If If conditon is true(i=8)it will display Welcome otherwise Wait. 3.if..then..elseif statement: We can use this type of statements when we want to execute more than one block of code.It can execute more than one statement whenever our condition is true or false. Example: if name="Abhi" then msgbox "Welcome Abhi!" elseif name="Jaleese" then msgbox "Welcome Jaleese!" elseif name="Shrish" then msgbox "Welcome Shrish!" else msgbox "R4R Welcomes You!" end If 3.select case statements: using select statement we can execute more than one blocks of code. Example: select case name case "Abhi" msgbox "Welcome Abhi!" case "Jaleese" msgbox "Welcome Jaleese!" case "Shrish" msgbox "Welcome Shrish!" case Else msgbox "R4R Welcomes you!" end select

Ques: 14 How to call a Sub or Function Procedure?

Ans:
You can call the function like that, name = name(); And we can returned the stored value like that, msgbox "Welcome: " & name() To call the Sub procedure by using Call statement. Like that, Call MyProc(argument) or you can neglect the Call statement,Like that, MyProc argument

Ques: 15 What is the VBScript Procedure?

Ans:
In VBScript their are two types of procedure available.They are Sub Procedure and Function Procedure. 1.Sub Procedure: In this series of statement are closed b/w the Sub and End Sub statements.It may be Sub procedure performs actions without returning any value.We can passed argument when we called this procedure.Their is no mandatry to pass argument b/w the parenteses. Syntax: Sub firstsub() Write some statements here End Sub 'OR' Sub firstsub(arg1,arg2) Write some statements here End Sub 2.Functional Procedure: In this series of statement must enclosed b/w the Function and End Functio statements.When it perform any action may return a value.We can passed arguments when we called the procedure.Their is no mandatry to pass argument b/w the parenteses.When we assign value to variable than it returns that value. Syntax: Function firstfunction() Write some statements here firstfunction=give some value End Function 'OR' Function firstfunction(arg1,arg2) Write some statements here firstfunction=give some value End Function

Ques: 16 How you define Array Variable in VBScript?

Ans:
When we created any Array variable than in this a variable can store more than one value.We declare an array variable using parenthesis(). Example: Here I declare a variable names. dim names(3) In this we declare an array variable names that can store only four values.We can assign value to each element of variable llike that, names(0)="Abhi" names(1)="Sudd" names(2)="Shrish" names(3)="Jaeleese" Now, we can perticular name entry from name variable to any other variable like that, friend=names(2)

Ques: 17 What do you understand from Lifetime of Variables?

Ans:
Existance period of variable are told as its Lifetime. When we declare a variable with a unique procedure.Than when this procedure perform assciated task and exits than variable holded by this procedure will destroyed.It may be happen Variable with same name exists with different procedure.Because each variable perform their specific task.These types of variables are called Local variable.

Ques: 18 How to declare and assign values to variable in VBScript?

Ans:
We can declare Dim,Public or Private statement in VBSCript like that. dim name name=Give some value Now,We created a variable named 'name'. When you declare variable with statements(Dim, Public or Private).Than we introduce 'option explicit' statement before decalring the script.Like: option explicit dim name name=give some value Example: name="Abhi" x=50

Ques: 19 What is the variable?

Ans:
We use variable to store information or values. We can change value of variable during the script.In VBScript all variables are type of variant so each variable can store different type of data. You have to keep some rules in mind when you create any variable. 1.Variable name can't more than 255 characters. 2.Variable name must start with a letter. 3.Variable name doesn't contain a period(.).

Ques: 20 In HTML where we insert VBScript?

Ans:
We used Script into the web pages in two ways. First we can set script to perform their specific task when web page will loaded. Second is that script will perform their associated task when used click or trigger an event. When we insert script in the head section: Script of head is executed when they are called or when an event is trigger in head section. Example: <html> <head> <script type="text/vbscript"> Write some statements here </script> </head> When we insert script in the body section: In this only those script are executed that are placed in body section. Example: <html> <head> </head> <body> <script type="text/vbscript"> Write some statements here </script> </body> When we insert script in both body and head section: You can insert script in both body and head section together. Example: <html> <head> <script type="text/vbscript"> Write some statements here </script> </head> <body> <script type="text/vbscript"> Write some statements here </script> </body>


Goto Page:

1 2
Share |

VBSCRIPT Objective

VBSCRIPT Objective Questions And Answers

VBSCRIPT Interview Questions And Answers

VBSCRIPT Subjective Questions And Answers

R4R,VBSCRIPT Objective, VBSCRIPT Subjective, VBSCRIPT Interview Questions And Answers,VBSCRIPT,VBSCRIPT Interview,VBSCRIPT Questions ,VBSCRIPT Answers

New Updates

R4R
R4R
R4R
R4R
R4R
R4R
R4R
R4R