VBScript Multiple choices


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

What is the correct way of creating functions in VBScript?


 

 

 

 



D


Solution:-

The most common way or method to define a function in VBScript is by using the Function keyword, followed by a unique function name and it may or may not carry a list of parameters and a statement with an End Function keyword. End Function keyword indicates the end of the function.

The basic syntax for the function is shown below?

<!DOCTYPE html>
<html>
?<body>
? ?<script language = "vbscript" type = "text/vbscript">
? ? Function Functionname(parameter-list)
? ? ? statement 1
? ? ? statement 2
? ? ? statement 3
? ? ? statement 4
? ? ? statement 5
? ? ? .......
? ? ? statement n
? ? End Function
? </script>
?</body>
</html>

The basic Example for the function is shown below 

<!DOCTYPE html>
<html>
?<body>
? ?<script language = "vbscript" type = "text/vbscript">
? ? Function HelloSlightBook()
? ? ? msgbox("Hello Welcome to the Slight Book World!")
? ? End Function
? </script>
?</body>
</html>

 




Next 5 multiple choice(s)

1

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

2

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

3

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

4

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

5

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

Comments