SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2006
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help With Variable Assignment

    Code:
    class test
    public event expire(byval i as integer)
    
      public sub causeExpire(byval i as integer)
       raiseEvent expire(i)
      end sub
    
    end class
    
    sub registerTime(byval t as integer)
      g_s &=t.tostring
    end sub
    
    sub Main()
     dim t as new test
     addhandler t.expire, addressof registertime
     addhandler t.expire, addressof registertime
     removeHandler t.expire, addressof registertime
     t.causeexpire(10)
    End sub
    Last edited by doran_doran; Mar 9, 2009 at 12:19.

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2006
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Value of x

    What is the value of x.value at the end of Main sub. (3, 4, 5, 6 or 7)

    Code:
    Structure Association
      Public name as String
      Public value as Integer
      Sub New (ByVal n As String, ByVal v As Integer)
         name = n
         value = v
      End Sub
    End Structure
    
    Sub Main()
      Dim x as New Association("foo",3)
      x.value=4
      Dim y As Association = x
      Dim z As New association("bar",5)
      y.value = 6
      z.value = 7
    End Sub

  3. #3
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,651
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Not sure, why don't you ask your teacher.

  4. #4
    SitePoint Zealot
    Join Date
    Aug 2006
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm. Not the answer I was looking for. In addition, web, forum is my teacher.


Bookmarks

Posting Permissions

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