Oops...Lets say the optional instance var was name?

-----Original Message-----
From: Justin Balog [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 25, 2003 10:22 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [CFCDev] Optional Instances of Components



I guess that was a bad exmaple, and it should be.  Lets the the optional
attribute was name?  How might you handle that? Thanks,

Justin

-----Original Message-----
From: Raymond Camden [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 25, 2003 10:10 AM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] Optional Instances of Components


Why wouldn't it not just be a boolean?

<cfset variables.tail = false or true>

========================================================================
===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email    : [EMAIL PROTECTED]
Blog     : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Justin Balog
> Sent: Thursday, September 25, 2003 9:45 AM
> To: '[EMAIL PROTECTED]'
> Subject: [CFCDev] Optional Instances of Components
> 
> 
> 
> Howdy,
> 
> I am just curious how you might handle optional instances 
> vars in components.  Lets say I have a dog cfc.  It always 
> has a weight, but as my dog (a welsh corgi) can attest he has 
> no tail.  Therefore, a dog may or may not have a tail.  Does 
> that mean that I just have an empty instance var? Here is how 
> I would currently write it. Then if the arguments were 
> available, I would use the setters individually?  Is there a 
> better way to do it?  Thanks much!  ----Sorry for the short 
> hand bellow.
> 
> 
> <cfcomponent>
>       <cfset variables.weight = "" />
>       <cfset variables.tail = "" />
> 
>       <cffunction init>
>               <cfargument name="weight"/>
>               <cfset setWeight(arguments.weight) />
>       </cffunction>
> 
>       <cffunction setWeight>
>       </cffunction>
> 
>       <cffunction getWeight>
>       </cffuction>
> 
>       <cffuction setTail>
>       </cffuction>
> 
>       <cffuction getTail>
>       </cffuction>
> 
> </cfcomponet>
> 
> 
> Justin
> 
> P.S. Just in case you were wondering what a tail less dog 
> looks like, here you go!  THEDUKE! (Just so everyone knows, I 
> did not cut his tail off.....he came form the rescue that way.)
> 
http://www.hossedia.com/desktops/duke_1024.jpg
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to