VBScript Multiple choices


Total available count: 25
Subject - Scripting Languages
Subsubject - VBScript

Which function is used to release the memory acquired by an array variable in VBScript?


 

 

 

 



C


Solution:-

VBScript Erase Function
The Erase function is used to reset the values of fixed-size arrays and the function free or release the memory of the dynamic arrays.

VBScript Erase Function Syntax is as below:

Erase ArrayName

Fixed numeric array, each element in an array is reset to Zero.
Fixed String array, each element in an array is reset to Zero-length " ".
In an array of Objects, each element in an array is reset to the special value Nothing.VBScript Erase Function Example is as follows:

<!DOCTYPE html>
<html>
 <body>
   <script language = "vbscript" type = "text/vbscript">
    Dim SlightBookArray(3)
    SlightBookArray(0) = "VBScript"
    SlightBookArray(1) = 1.05
    SlightBookArray(2) = 25
    SlightBookArray(3) = #23/04/2013#

    Dim DynamicArray()
    ReDim DynamicArray(9)  ' Allocate storage space.

    Erase SlightBookArray     ' Each element is reinitialized.
    Erase DynamicArray   ' Free memory used by array.

    ' All values would be erased.
    Document.write("At Zero index the value of SlightBookArray is " & SlightBookArray(0) & "<br />")
    Document.write("At First index the value of SlightBookArray is " & SlightBookArray(1) & "<br />")
    Document.write("At Second index the value of SlightBookArray is " & SlightBookArray(2) & "<br />")
    Document.write("At Third index the value of SlightBookArray is " & SlightBookArray(3) & "<br />")

   </script>
 </body>
</html>

When the above code is saved as .HTML and executed in Browser, it produces the following output −

At Zero index, the value of SlightBookArray is 
At the First index, the value of SlightBookArray is 
At the Second index, the value of SlightBookArray is 
At the Third index, the value of SlightBookArray is 




Next 5 multiple choice(s)

1

Which function is used to check that a variable is in array or not in VBScript?

2

Which function is used to get a subset of an array in VBScript?

3

Which function is used to get a combined string from an array of string in VBScript?

4

Which function is used to split a string into an array in VBScript?

5

Which function is used to get the largest subscript of an array in VBScript?

Comments