[PHP] Help: arrays in a class

2004-01-28 Thread jazzman
Hi all, I'm having some trouble here and I hope you can help. I'm writing a class for PHP to help track includes in a c++ source file. My class has 3 member variables: a filename file contents array of files that file includes The class definition looks like this

Re: [PHP] Help: arrays in a class

2004-01-28 Thread John Nichel
[EMAIL PROTECTED] wrote: snip Here's the problem. In ParseFile I call the function: array_push($this-$includedFiles, $ifName); Here you have it ending in an 's' where $ifName is the name of an include file I found in the code. However, I get an error stating the first argument must be an

Re: [PHP] Help: arrays in a class

2004-01-28 Thread John W. Holmes
From: [EMAIL PROTECTED] class clsfTreeNode { //member variables var $fName; var $fData; var $includedFiles; //constructor function clsfTreeNode( $fileName ) { $this-$fName = $fileName; $this-$fData = file_get_contents($this-$fName); $this-ParseFile(); You have an extra $ sign

Re: [PHP] Help: arrays in a class

2004-01-28 Thread John Nichel
John W. Holmes wrote: snip You have an extra $ sign in your variables names. $this-fName instead of $this-$fName Not sure if that'll solve all your problems, but it's a start. ---John Holmes... Oh, sure. Point out what I missed in my eval. ;) -- By-Tor.com It's all about the Rush

Re: [PHP] Help: arrays in a class

2004-01-28 Thread jazzman
On Wed, 28 Jan 2004 [EMAIL PROTECTED] wrote: in php you have to access a member variable (or methods) with: $this-varname (without the $) e.g.: $this-includedFile = array(); hope this helps AHA! I think that's it. The comment someone sent to me (Sorry, i'm awful with names) about