Thread: Dynamics
View Single Post
  #1  
Old 12-01-2006, 12:59 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Dynamics

A small concern..
PHP Code:
function onCreated() {
 
temp.func "onTest";
 
temp.paramz = {1,2,3};
 (@
temp.func)(@temp.paramz);
}
function 
onTest(j,e,r) {
 echo(
"Test:" SPC j SPC e SPC r);
}
/*
RC Output:
Test: 1,2,3 0 0
 
Result:
j=1,2,3
e=0
r=0

Desired Result:
j=1
e=2
r=3
*/ 
Is there another way I can workaround this without using else if statements, like in my below example?

PHP Code:
function onCreated() {
 
temp.func "onTest";
 
temp.paramz = {1,2,3};
 if (
temp.paramz.size() == 3) (@temp.func)(temp.paramz[0],temp.paramz[1],temp.paramz[2]);
 else if (
temp.paramz.size() == 2) (@temp.func)(temp.paramz[0],temp.paramz[1]);
 else if (
temp.paramz.size() == 1) (@temp.func)(temp.paramz[0]);
}
function 
onTest(j,e,r) {
 echo(
"Test:" SPC j SPC e SPC r);

__________________
Quote:
Reply With Quote