Functions (VBScript)

In VBScript, a function is a type of programming function that returns a value. The only difference between a function in VBScript and a procedure in VBScript is that a function returns a value.

The syntax for a function in VBScript is as follows:

Dim Name

Name = GetUserName()
MsgBox(Name)

Function GetUserName()
    GetUserName = InputBox("Please enter your name")
End Function
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License