Thursday, January 3, 2019



Difference between procedures and functions in vb script

Major difference between procedures and functions in vb script is that procedures can not return the value but functions can return the value.

Procedure Example -

Sub findsq()
   temp = InputBox("Please enter the number", 1)
   MsgBox "square root of the num is " & sqrt(temp)
End Sub


'Function Example
a = findsq()  ' function returns the value in variable a
msgbox a

function findsq()
 temp = InputBox("Please enter the number", 1)
findsq = sqrt(temp)
End function


Related Posts:

  • How to get the IP Address of System in vbscript. How to get the IP Address of System in vbscript. Here is a program that can be run to get the IP address of system.'Get the WMI object for local computerstrComputer = "."Set objWMIService = GetObject("winmgmts:" _&nbs… Read More
  • How to list all files in cookies in vbscript? How to list all files in cookies in vbscript? Cookie is a file stored by the web server on web client machine.If you want to find out the cookies in your machine you can use below program.Const COOKIES = &H21&S… Read More
  • What is WMI? What is WMI?  WMI and Win32 classes WMI stands for Windows Management Instrumentation. This is used to access system hardware and software features. It provides very powerful API to perform tasks like starting pr… Read More
  • How to terminate the process in vbscript How to terminate the process in vbscript Here is the vbscript  that will terminate or close all the processes with given nameIn below script I am closing internet explorer process.'Create a WMI objectstrComputer … Read More
  • How to create a word document using vbscript How to create a word document using vbscript ' Create and Save a Word Document'Create the Word objectSet objWord = CreateObject("Word.Application")'Set the caption of the WordobjWord.Caption = "Welcome to Automated Wo… Read More

0 comments:

Post a Comment

Blog Archive

Translate

Popular Posts

Total Pageviews

150,603

Blog Archive