On 7/11/07, Nathan Strutz <[EMAIL PROTECTED]> wrote:
> I think the reason why people would vote "no" to the main question is that
> we know in an OOPL we create an object and call methods on it. new struct(),
> struct.keyList(), but in CF we do structNew(), structKeyList(myStruct). It
> doesn't "feel" OO, even as much as javascript does, unless you're heavily
> using CFCs for everything.

<cfset s = { a = 1, b = "two", c = "3" } />

<cfdump label="s" var="#s#" />
<cfoutput>
        <p>s.size() = #s.size()#</p>
        <cfdump label="s.keySet().toArray()" var="#s.keySet().toArray()#" />
        <cfset iter = s.keySet().iterator() />
        <cfloop condition="iter.hasNext()">
                <cfset x = iter.next() />
                <p>s.get(#x#) = #s.get(x)#</p>
        </cfloop>
</cfoutput>

But of course you could have done:

<cfloop item="x" collection="#s#">
    <p>s[#x#] = #s[x]#</p>
</cfloop>
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion 8 beta – Build next generation applications today.
Free beta download on Labs
http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:283517
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to