On Friday, Nov 1, 2002, at 12:01 US/Pacific, Chris Kief wrote:
> That was my understanding as well. But what I was attempting to
> demonstrate was that CF is able to auto-retype certain variables and 
> not
> others.

Well, not really - see below.

> <!--- auto-create a struct --->
> <cfset myStruct.foo = "bar" />

Equivalent to:
        <cfif not isDefined("myStruct")>
                <cfset myStruct = structNew()/>
        </cfif>
        <cfset myStruct.foo = "bar"/>

Not that it only performs the implicit assignment of a new struct if 
the variable doesn't already exist.

> <!--- have cf retype to string --->
> <cfset myStruct = "foo" />
>
> That works fine.

Yes, because you are assigning the whole variable.

> <!--- create a string --->
> <cfset myString = "foo" />

Yes, makes myString a *string*

> <!-- have cf retype to struct --->
> <cfset myString.1 = "foo" />
>
> That fails.

Yes, and correctly so: myString is a *string* at this point so you 
cannot access any members...

This is not a bug.

"SOAP is not so much a means of transmitting data
  but a mechanism for calling COM objects over the Web."
-- not Microsoft (surprisingly!)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Reply via email to