Monday, February 14, 2011

VBscript: Sample script for msg box with class

Class Hello_World
Public Sub Say_Hello(Name)
                        MsgBox "Hello, " & Name & ", welcome to " & Garden & "."
            End Sub
            Public Garden
End Class

Dim MyHello_World

Set MyHello_World = New Hello_World

            MyHello_World.Garden = "Fountain"
            MyHello_World.Say_Hello(MyHello_World.Garden)

            MyHello_World.Say_Hello "Sachin"
            MyHello_World.Say_Hello(MyHello_World.Garden)

No comments:

Post a Comment

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | JCpenney Printable Coupons