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 What is the VBScript?

Ans:
It is an Scripting language provided by Microsoft.We can say tat it is an lightweight edition of the Visual Basic(It is an Microsoft,s programming language). It's functionality is dependant upon either ASP engine or windows scripting host.VBScript is only supported by internet explorer.

Ques: 2 How can we add VBScript to web pages? 

Ans:
We use scripting language like VBScript and JavaScript as the extension of HTML language.Only internet explorer read the VBScript and its has a work to read Script with whole content of an web page and to excute them. These are use as an client side scripting language.

Ques: 3 What are the Variants in VBScript?

Ans:
Variant are the single datatype(Kind of data that we store in variable.Datatype may be a character data,string data,number data, boolean data and byte data.)that we used in VBScript.

Ques: 4 What is the use of ReDim statement in VBScript?

Ans:
Using ReDim statement we can change the size of an array in VBScript.I have given you example how to use ReDim. Example: Suppose you declare an array Dim Clients(50) Now if you want to change the size of client than you can oerform this task with the help of ReDim Like that: ReDim Customers(70)

Ques: 5 How Visual Basic is differ from VBScript?

Ans:
VBScript is much differ from Visual Basic.I have given you some important difference b/w them. 1.Both VBScript and VBScript are compiled in different way. 2.Internet explorer support VBScript on your PC and also we can create web pages using VBScript. Where in case to run Visual Basic you need some like text editor,ActiveX,Control Pad and Web Browser.

Ques: 6 How you differenciate Dim, Public and Private statements in VBScript? 

Ans:
Some information about Dim,public and Private statements are When we declare private statement variable than these variable are available only in taht script in which they are declared. When we declare public statement variable than it will be available for all procedures of all scripts. When we declare Dim statement variable at the script level are available for all procedures of all scripts.Where as at the procedure level variables are available only in procedure.

Ques: 7 Tell me what plateforms supported by VBScript?

Ans:
VBScript is suppoted by plateform.These are Windows 95,Windows NT,Windows(16 bits),Unix solaris.

Ques: 8 What's the scope of variable in VBScript?

Ans:
Generally scope of the variable means we can set an variable can access in whole function or it only access by its local instance.Because of scode of variable we can say variable are of two types Local and Global variables. I have explain this with an example. <script> Dim name Sub cmdclickme_OnClick Dim age End Sub </script> In this we example we declare variable 'name' outside the sub procedure.So, 'name' variable is worked as global variable it can access by all procedure in all script of web page.But we declare 'age' variable inside the sub procedure. So, age variable only accessed with in the sub procedure.Than we can say that 'age' is an local variable.

Ques: 9 How we used VBScript with HTML?

Ans:
When we want to insert any script into HTML page than we used <script>tag and use type attribute to define what scripting language we used. Example: <script type="text/vbscript"> I have given you example in which I used VBScript with HTML document. Example: <html> <head> </head> <body><script type="text/vbscript"> document.write("This is my first HTML page with VBScript.") </script></body> </html> Output: This is my first HTML page with VBScript.

Ques: 10 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>

Ques: 11 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: 12 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: 13 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: 14 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: 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 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: 17 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: 18 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: 19 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: 20 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.


Goto Page:

1 2
Share |

VBSCRIPT Objective

VBSCRIPT Objective Questions And Answers

VBSCRIPT Interview Questions And Answers

VBSCRIPT Interview 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