matak

06-03-2007, 04:58 AM

I cant figure how to escape function which creates array, and then goes to antoher function. Problem is that function calls that other function X times the array is created. Here's the logic

function guess_where($1,$2,$3) {

// for() function guesses numbers where 2, 5, 10, etc..

//

create_array($1) //calling a function what creates array from numbers found

}

function create_array($1){

GLOBAL $2;

GLOBAL $3;

//the part where array is created

use_array($array, $2, $3)

}

function use_array($array, $2, $3){

//beacouse of the logic of the first function this function is egzecuted

//X number of times depending on the size of the array

}

I can't figure out, how to CALL a function, only when the whole array is crated, instead that it goes through whole FOR loop calling create_array function every time..

Here's my guess_where function logic

function guess_where($1,$2,$3) {

for($a; $a < sizeof($2; $a++)

$term1 //1st term

$term2 //2nd term

if ($term1 == $term2):

create_array($1);

endif;

}

Hope this isn't bothering you too much. And thanks for the help!

function guess_where($1,$2,$3) {

// for() function guesses numbers where 2, 5, 10, etc..

//

create_array($1) //calling a function what creates array from numbers found

}

function create_array($1){

GLOBAL $2;

GLOBAL $3;

//the part where array is created

use_array($array, $2, $3)

}

function use_array($array, $2, $3){

//beacouse of the logic of the first function this function is egzecuted

//X number of times depending on the size of the array

}

I can't figure out, how to CALL a function, only when the whole array is crated, instead that it goes through whole FOR loop calling create_array function every time..

Here's my guess_where function logic

function guess_where($1,$2,$3) {

for($a; $a < sizeof($2; $a++)

$term1 //1st term

$term2 //2nd term

if ($term1 == $term2):

create_array($1);

endif;

}

Hope this isn't bothering you too much. And thanks for the help!