[Tutor] Tracking variable changes in a different application

Alan Gauld alan.gauld at btinternet.com
Wed Sep 2 09:54:35 CEST 2009


"Kristina Ambert" <krissy.ambert at gmail.com> wrote

> The question might be a tad confusing, but what I want to ask is, if it's
> possible to track if and when a variable in an application has changed, 
> and
> then grab the new content of that variable?

Not in general. Variables change too quickly for that to be viable - think
about a loop counter in a while loop, it could change millions of times
per second!

> I have my product inventory database application which is attached to
> another bigger application. Some of the data I need comes from that 
> bigger
> application, like for instance Consumer information (not handled by the
> application that I'm working on). So, if the address of a consumer is
> changed, how my application track the changes

But this is different. I assume the other app is storing its data in a 
database?
If so that database may suppport triggers which can call a stored procedure
when an item (table, row,column) changes. That stored procedure can notify
your app of the change. Of course that relies on you having access to the
same database as the other app, but that sounds very likely in this 
scenario.

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/ 




More information about the Tutor mailing list