Hi Michel,
>The values of lnLeft and lnTop, for example, are passed by reference.
I doubt so, as JavaScript only support passing parameters by value.
What probably happens is that lnLeft, not being defined by var lnLeft, is created as a property of the global object (window when executing in a browser); when onMouseOut() executes, it takes whatever lnLeft is in scope, eg window.lnLeft.
You can check that by reviewing the 'DOM' tab in FireBug (very similar to the 'locals' window in VFP debugger)
>What would be the best approach to pass a variable value?
You need to use the powerful JavaScript function
'apply'; a method of function.prototype, .apply() allows you to set the this keyword and/or the arguments the function will take at runtime.
You can review how this method works here:
http://api.jquery.com/Types/#Context.2C_Call_and_ApplyPrototype.js (that I've been using since 2006) provides a convenient wrapper around .apply() called
.curry(). However, could not find anything close in jQuery.
>In this line:
>
>
> oDiv.onmouseout=function(e) {OnMouseOut(e,tcAlignID,lnLeft,lnTop,lnWidth,lnHeight)}
> lnLeft=lnLeft-tnAlignOffsetLeft
> lnTop=lnTop-tnAlignOffsetTop
>
>
>The values of lnLeft and lnTop, for example, are passed by reference.
>
>However, once the event is triggered, the value is not what was passed but the adjusted value in the lines following.
>
>What would be the best approach to pass a variable value?
Thierry Nivelet
FoxinCloud
Give your VFP application a second life, web-based, in YOUR cloud
http://foxincloud.com/Never explain, never complain (Queen Elizabeth II)