|
Posted by Tim Roberts on 05/26/06 08:35
"Chris" <Chris@dustbubble.nospam.com> wrote:
>
>I am clearly missing something simple here....
>...
>I am calling the function like this :
>
> $BrokenArray = array();
> $BrokenArray = $this->fileTree($this->ProjectRoot,".c");
Do you understand that the first statement is useless? This creates an
empty array, assigns it to $BrokenArray, and then promptly deletes it, to
be replaced by whatever fileTree returns.
> foreach (($this->fileTree($this->ProjectRoot,".c")) as $wibble)
> {
> print "Broken Array : $wibble <br>\n";
> }
>
>
>So it seems that the array in the function contains the right data, and by
>doing "$BrokenArray = array();" i suspect I am making sure the varible it is
>being assinged to isnt a scalar,
No. You can't change what fileTree returns. If it returns an array,
$BrokenArray will be an array. If it returns a scalar, $BrokenArray will
be a scalar. $this->fileTree has absolutely no clue that $BrokenArray
exists. If fileTree is supposed to return an array, then it must construct
an array and return it.
The other Tim gave you the rest of the hints you need to make this work.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Navigation:
[Reply to this message]
|