Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing value not a reference
Message
From
21/03/2016 10:05:12
 
 
General information
Forum:
Javascript
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01633405
Message ID:
01633419
Views:
39
>Integers are passed by value (I'm assuming lnLeft/lnTop *are* integers) so something else must be going on.
>e.g:
                 var i = 5;
>                  oDiv.onmouseout = function(e) {
>                      OnMouseOut(e, i);
>                      alert("After"+i); // 5
>                  };
>                  
> 
>                  function OnMouseOut(e, i) {
>                      i = i + 1;
>                  }
Yes, I would adjust to use the var declaration approach instead.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform