On 7/28/05, Troy Simpson <[EMAIL PROTECTED]> wrote:
> Is there a way to determine what type an Object/CFC is?  For example:
> 
> oPatron = createObject("component","patron").init();
> IsObject(oPatron, "patron") )
> 
> 
> I am using ColdFusion MX 6.1 for Sun Solaris.
> 

As a native function? Not that I'm aware of. I created this UDF a long
time ago to solve this exact issue, and it works like a charm. Feel
free to steal it.

<cffunction name="isInstanceOf" output="No" returntype="boolean"
hint="I check to see whether a given object is an instance of the
specified instance type.">
        <cfargument name="obj" type="Any" required="Yes" hint="Any CFC 
instance." />
        <cfargument name="name" type="string" required="Yes" hint="The name
to check against." />
        
        <cfreturn (not
compareNoCase(listLast(getMetaData(arguments.obj).name, "."),
arguments.name)) />
</cffunction>

Regards,
Dave.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:213203
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to