Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Track Changes to a variable

Posted on 2005-04-18
Medium Priority
Last Modified: 2010-04-23
how do i track the changes made to a variable... i want to know what is changing the varaible and where in code it is located.  
Question by:BangorCC

Expert Comment

ID: 13810247

I don't know if this looks practical but if you replace your variable by an object and implemenet some code for that class so it can keep track of previous changes, that might solve your problem.

A class like this emulating a string variable would be something like:

    Class StringTrack
        Dim sValue As String
        Public Property Value() As String
                Return sValue
            End Get
            Set(ByVal Value As String)
                sValue = Value
            End Set
        End Property
    End Class

And you use it like:

        Dim sTrack As New StringTrack
        sTrack.Value = "HELLO"
        sRead = sTrack.Value

And/or you can create a method called like SetValue that accepts additional parameters that provide details you can save in your internal track log for further analysis.

LVL 25

Accepted Solution

RonaldBiemans earned 2000 total points
ID: 13815312
You could add the variable to a watch (right the variable, choose quickwatch, choose add watch), and use this together with the call stack window to trace the changes made to the variabele

Author Comment

ID: 13861481
not quite what i was looking for but it works

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question