Hi all,
For simple variables I find this an odd feature,
might be even dangerous and may also affect
performance. Not to mention how many odd cases
it may generate (think of recursion if the trigger
block modifies the triggering variable, variables
referencing other variables, and handling arrays
- even embedded ones, let alone objects).
Also, for variables a very easy and proper alternate
solution is to use simple set/get methods/functions,
and hiding the variable as hidden object var or simple
static var.
For fields it might be useful though, but as Przemek
says, we already have it.
Brgds,
Viktor
On 2008.09.24., at 21:18, Chen Kedem wrote:
This submitted to the Harbour SF as feature request (I just forward
it as is)
https://sourceforge.net/tracker/index.php?func=detail&aid=2122754&group_id=681&atid=350681
---------------------------------------------
is it possible for you to implement a "data trigger" (for vars,
fields,
object and so on) defining a code block called when the object
changes his
value...
example of code
function main()
local nvar as numeric
nvar := 1
//
// set trigger (for example)
//
_set_trigger("nvar",{|cName,Value| qout(cName+" new
value:"+str(Value)}
// trigger is called immediately after nvar value change
nvar++
return NIL
result:
NVAR new value: 2
---------------------------------------------
Chen.
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour