question about structures
I am a little bit confused about declaring a structure. Take a look at the following: cfset name.first = mike / cfset name.last = soultanian / Assuming that I never explicitly declared name as a struct, is the preceding code segment valid? If I then do a cfdump var=#name# / it will say that it's a struct, even though I didn't actually declare it using structnew(). The reason I ask is because I have noticed, especially in CFCs, that coders will use variables.instance.variable names without ever declaring variables.instance as a structure. Any thoughts? Thanks, Mike ~| 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:220071 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
Re: question about structures
Ok, nevermind. A quick look into my programming cf mx book after I sent this email mentioned that creating a variable with the period notation will automatically create a structure. thanks, Mike Mike Soultanian wrote: I am a little bit confused about declaring a structure. Take a look at the following: cfset name.first = mike / cfset name.last = soultanian / Assuming that I never explicitly declared name as a struct, is the preceding code segment valid? If I then do a cfdump var=#name# / it will say that it's a struct, even though I didn't actually declare it using structnew(). The reason I ask is because I have noticed, especially in CFCs, that coders will use variables.instance.variable names without ever declaring variables.instance as a structure. Any thoughts? Thanks, Mike ~| 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:220072 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=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: question about structures
as of CFMX (I believe), you could implicitly create a structure like that, yes. since periods are not valid characters in variable names, CF sees it and assumes struct/key, and creates the struct. On 10/4/05, Mike Soultanian [EMAIL PROTECTED] wrote: I am a little bit confused about declaring a structure. Take a look at the following: cfset name.first = mike / cfset name.last = soultanian / Assuming that I never explicitly declared name as a struct, is the preceding code segment valid? If I then do a cfdump var=#name# / it will say that it's a struct, even though I didn't actually declare it using structnew(). The reason I ask is because I have noticed, especially in CFCs, that coders will use variables.instance.variable names without ever declaring variables.instance as a structure. Any thoughts? Thanks, Mike ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220074 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