I am new to vbscript and trying to use the below code with a Function and then a Sub Procedure. I am confused as to why I have to "call" the function as it should itself return the value without calling the function. Please see the below pieces of code - one with Function and the other one with Sub Procedure.
Function -
Systemutil.Run"C:\Program Files\Internet Explorer\iexplore.exe","www.gmail.com"
Function tester()
Set tester=Description.Create
tester=Browser("title:=Gmail").Page("title:=Gmail").WebButton("html id:=next").GetROProperty("Name")
print tester
End Function
Call tester
If I don't call the function, it doesn't return anything.
I have used function name as a variable to output the value.
Sub Procedure-
Systemutil.Run"C:\Program Files\Internet Explorer\iexplore.exe","www.gmail.com"
Sub tester()
Set X=Description.Create
X=Browser("title:=Gmail").Page("title:=Gmail").WebButton("html id:=next").GetROProperty("Name")
print X
End Sub
Call tester
My question is why doesn't the first script work without calling the Function.