VBScript Basics, Part 11 | Subroutines


VBScripting (.vbs) Basic tutorial on how to create, and call a subroutine or sub, which stores code until you need it.

Code Example:
______________________________________________________

Option Explicit
Dim x

Sub Greet(user)
msgbox “Hello, ” & user
End Sub

x=InputBox(“Please Type in your name”)
Call Greet(x)
______________________________________________________

Know the Basics:
——————————————————————————————
Sub SubName(argument1, argument2, argument3 , etc…)
code inside the sub
End Sub

Call SubName(“arg1” , “arg2”, etc…)
——————————————————————————————



Leave a Comment