Hi
Can I update function parameters in a function ... I have some code but it does need seem to pass back variables updated in functions ... in the example below c1 and c2 are not updated following the call to updatemyvariables??????
Thanks - any help appreciated
Paul
var c1; //global variable
var c2; //global variable
function preMain() {
c1 = 0;
c2 = 0;
}
function main() {
updatemyvariable(c1,c2);
}
function updatemyvariable(x1,x2) {
x1 = x1+1;
x2 = x2+1;
}
Can I update function parameters in a function ... I have some code but it does need seem to pass back variables updated in functions ... in the example below c1 and c2 are not updated following the call to updatemyvariables??????
Thanks - any help appreciated
Paul
var c1; //global variable
var c2; //global variable
function preMain() {
c1 = 0;
c2 = 0;
}
function main() {
updatemyvariable(c1,c2);
}
function updatemyvariable(x1,x2) {
x1 = x1+1;
x2 = x2+1;
}
Comment