Skip to content

Instantly share code, notes, and snippets.

@pravynandas
Created August 21, 2017 14:47
Show Gist options
  • Save pravynandas/970e4d110dc846f1b5248371f2d9682d to your computer and use it in GitHub Desktop.
Save pravynandas/970e4d110dc846f1b5248371f2d9682d to your computer and use it in GitHub Desktop.
How to write a class in a VBS (vbscript file)
set clshw = new helloworld
before = clshw.SayHi()
clshw.Smile = “….. NOW I AM IN CLASS :D”
after = clshw.SayHi()
set clshw = nothing
msgbox before & vbcrlf & after
class helloworld
private pvt_smiley
public property Let Smile(smiley)
pvt_smiley = smiley
end property
public property get SayHi()
SayHi = “Hello World !” & pvt_smiley
end property
end class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment