Results 1 to 5 of 5

Thread: Changing variable in different class

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830

    Changing variable in different class

    Looking for the best way to update a variable in a different class. Below is a rough outline of the situation.

    I am wondering if in fnSendEmailTo if I can access the Property in CB? If not, how would you do something like this?

    Code:
    file: CB.vb
    ----------------------------
    Imports Project.Functions
    
    Public Class CB
     Private _CurrentEmailsSentCount As Integer = 0
     Private _ID As Integer = 23
    
        Public Property CurrentEmailSentCount() As Integer
            Get
                Return _CurrentEmailsSentCount
            End Get
            Set(value As Integer)
                _CurrentEmailsSentCount = value
            End Set
        End Property
    
     Public Function fnStart() As String
    	CurrentEmailSentCount = fnGetJobPostingID_EmailsSentCount(_ID)
    	Return sRetVal
     End Function
    End Class
    
    file: Functions.vb
    ----------------------------
    Public Class Functions
    
     Public Shared Function fnSendEmailTo(...various parameters..) As String
       '... code
       If iEmailSent = 1 Then
        'update the _CurrentEmailsSentCount variable here from class CB
        CurrentEmailSentCount += 1
       End If
       '... code
     End Function
    End Class
    Last edited by lleemon; Mar 8th, 2012 at 11:54 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width