I have designed a class that multiplies one of the varibles by two but when
i pass the values to the contructor i cant get the answer out any ideas
Here is the full script "If you can recognise the problem can you explain
why its wrong and why its not working "Ps learning the langauge "
The Class File
class purchase {
var $PartNumber;
var $Description;
var $Unitprice ;
// this is the constuctor
function purchase($partnumber,$desc,$price)
{
$this->PartNumber = $partnumber;
$this->Description =$desc;
$this->Unitprice =$price;
echo "Object created partNumber = $this->PartNumber <br>";
echo " This Objects Description = $this->Description <br>";
echo " This Objects Price is $this->Unitprice <BR>";
//this doesnt work why ??
echo " price * two is $this->Unitprice*2<BR>";
}// end constructor
}
$myObject = new purchase(1,"Speaker",23.00);
?>
[EMAIL PROTECTED]
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php