classes/methods in vbscript

Results 1 to 2 of 2

Thread: classes/methods in vbscript

  1. #1
    Join Date
    Dec 1969

    Default classes/methods in vbscript

    i created two classes in an asp file. the first class contains a member that is an object of the second class. the second class has a method named party.<BR><BR>in another asp page i include the class definition file. then, i instantiate a variable as an object of the first class.<BR><BR>how does my variable call the party method?

  2. #2
    Join Date
    Dec 1969

    Default Code would have been nice

    Class One<BR> [hl="yellow"]Public[/hl] _two<BR><BR> Private Sub Class_Initialize<BR> Set _two = New Two<BR> End Sub<BR> <BR> Public Property Get OneTwo( )<BR> Set OneTwo = _two<BR> End Property<BR><BR> Public Function GetTwo( )<BR> Set GetTwo = _two<BR> End Function<BR><BR>End Class<BR><BR>Class Two<BR> Public Sub Party( )<BR> Response.Write "Party on, Dude!"<BR> End Sub<BR>End Class<BR><BR>...<BR><BR>Set myOne = New One<BR><BR>[hl="yellow"]myOne._two.Party( )[/hl]<BR> **OR**<BR>myOne.OneTwo.Party( )<BR> **OR**<BR>myOne.getTwo().Party( )<BR> **OR**<BR>[hl="yellow"]Set myTwo = myOne._two<BR>myTwo.Party( )[/hl]<BR> **OR**<BR>Set myTwo = myOne.OneTwo<BR>myTwo.Party( )<BR> **OR**<BR>Set myTwo = myOne.getTwo( )<BR>myTwo.Party( )<BR><BR>***************************************** *<BR><BR>The highlighted versions of calling Party are *only* available if the member _two in Class One is Public (also highlighted). If it is Private, then you must use one of the other versions.<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts