RE: pointers in cfmx

2003-03-26 Thread Ken Beard
nevermind, it works, i was being stupid.
ken

-Original Message-
From: Ken Beard [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 11:58 AM
To: [EMAIL PROTECTED]
Subject: pointers in cfmx


cfset person1=structnew()
cfset person2=person1
cfset person2.name=ken

cfoutput#person1.name#/cfoutput



this would yield ken in cf5, but in cfmx, you get an error on line 2
saying Complex object types cannot be converted to simple values.


so are there no pointers in cfmx??  any other way i'm not aware of to cut
down on long complex object references?

ken

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



Re: pointers in cfmx

2003-03-26 Thread Dave Carabetta
cfset person1=structnew()
cfset person2=person1
cfset person2.name=ken

cfoutput#person1.name#/cfoutput

this would yield ken in cf5, but in cfmx, you get an error on line 2
saying Complex object types cannot be converted to simple values.


so are there no pointers in cfmx??  any other way i'm not aware of to cut
down on long complex object references?

This doesn't have do to with pointers. In CFMX, any variables with a . in 
it are automatically converted into structures. So, in your example, 
person2.name is now a structure with a key of name and a value of ken, not 
a simple value. Hence your error.

This feature is documented in several places in the documentation, but I 
don't have the link handy. Check out the Migration Apps documents at 
livedocs.macromedia.com for more information.

Regards,
Dave.



~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: pointers in cfmx

2003-03-26 Thread Dave Watts
  cfset person1=structnew()
  cfset person2=person1
  cfset person2.name=ken
 
  cfoutput#person1.name#/cfoutput
 
  this would yield ken in cf5, but in cfmx, you get 
  an error on line 2 saying Complex object types cannot
  be converted to simple values.
 
  so are there no pointers in cfmx?? any other way i'm not 
  aware of to cut down on long complex object references?
 
 This doesn't have do to with pointers. In CFMX, any variables 
 with a . in it are automatically converted into structures. 
 So, in your example, person2.name is now a structure with a 
 key of name and a value of ken, not a simple value. Hence 
 your error.

No, actually, Ken's original error was one of testing, as I think he's since
discovered.

In the case of the above code, person2 is a structure because it was created
using person1. The value of the name key in person2 (or person1 for that
matter) is a simple value, so you can safely output person1.name.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4