Re: Storing Arrays or Structures in a database
Not if any value has a comma in it. You can use other delimiters, but then you just have a different problem. On Wed, Apr 6, 2011 at 4:38 PM, Bobby Hartsfield bo...@acoderslife.com wrote: Assuming you are dealing with one dimensional arrays, sure, converting it to a list could work. .:.:.:.:.:.:.:.:.:.:.:.:.:. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343596 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Storing Arrays or Structures in a database
Hence the could. There are plenty of wrenches to throw into it (like the delimiter character being used as a normal character in one of the values). .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com -Original Message- From: Raymond Camden [mailto:rcam...@gmail.com] Sent: Thursday, April 07, 2011 9:43 AM To: cf-talk Subject: Re: Storing Arrays or Structures in a database Not if any value has a comma in it. You can use other delimiters, but then you just have a different problem. On Wed, Apr 6, 2011 at 4:38 PM, Bobby Hartsfield bo...@acoderslife.com wrote: Assuming you are dealing with one dimensional arrays, sure, converting it to a list could work. .:.:.:.:.:.:.:.:.:.:.:.:.:. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343604 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Storing Arrays or Structures in a database
I've got really large sets of data that are related to each day of the week and the hour. Rather then creating a massive table containing these values, I have stored them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343572 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Storing Arrays or Structures in a database
Serialize them as JSON or WDDX and store them as text. On Wed, Apr 6, 2011 at 1:41 PM, Adam Bourg adam.bo...@gmail.com wrote: I've got really large sets of data that are related to each day of the week and the hour. Rather then creating a massive table containing these values, I have stored them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343573 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Storing Arrays or Structures in a database
cfwddx action=cfml2wddx input=#ARGUMENTS.workWeek# output=wddxworkWeek On Wed, Apr 6, 2011 at 12:41 PM, Adam Bourg adam.bo...@gmail.com wrote: I've got really large sets of data that are related to each day of the week and the hour. Rather then creating a massive table containing these values, I have stored them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343574 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
re: Storing Arrays or Structures in a database
Serialize with WDDX or JSON, I would say. Those are complex variable types which need to be serialized into strings before insertion into a DB. From: Adam Bourg adam.bo...@gmail.com Sent: Wednesday, April 06, 2011 1:49 PM To: cf-talk cf-talk@houseoffusion.com Subject: Storing Arrays or Structures in a database I've got really large sets of data that are related to each day of the week and the hour. Rather then creating a massive table containing these values, I have stored them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343575 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Storing Arrays or Structures in a database
Arrays are easy as you can simply use Arraytolist() to convert it to a delimited text string and then use ListtoArray() to convert back once you get it out. Though, CF has some really nice list functions, so you might not even have to do that. Also, select boxes return comma separated lists back to CF when a form is submitted (ditto for checkboxes with the same name)... So that might work in your favor. For structures though, WDDX is your friend, and quite easy to do... Try cfwddx action=CFML2WDDX input=#workweek# output=workweekXML Then stuff workweekXML into the database field. When you retrieve the data back out of the database, use cfwddx again to convert back to a CF structure cfwddx action=WDDX2CFML input=queryname.databaseWDDXField output=localStructVariable Just make sure that your db field can handle a decent sized chunk of data, especially if you are allowing user defined data in this column as the WDDX format can get kinda bloated. -Original Message- From: Adam Bourg [mailto:adam.bo...@gmail.com] Sent: Wednesday, April 06, 2011 10:41 AM To: cf-talk Subject: Storing Arrays or Structures in a database I've got really large sets of data that are related to each day of the week and the hour. Rather then creating a massive table containing these values, I have stored them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343576 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Storing Arrays or Structures in a database
Keep in mind that WDDX adds quite a bit of extra stuff around your data as compared to JSON. For example, take this ColdFusion array: cfset myArray = [John,Paul,George,Ringo] Here is the serialized JSON version: [John,Paul,George,Ringo] Here is the WDDX version: wddxPacket version='1.0'header/dataarray length='4'stringJohn/stringstringPaul/stringstringGeorge/stringstringRingo/string/array/data/wddxPacket The larger the array or structure, the bigger the bloat from WDDX, and the more database space required to store it. This needs to be considered when designing your database columns. HTH, Carl On 4/6/2011 10:52 AM, Michael Grant wrote: Serialize them as JSON or WDDX and store them as text. On Wed, Apr 6, 2011 at 1:41 PM, Adam Bourgadam.bo...@gmail.com wrote: I've got really large sets of data that are related to each day of the week and the hour. Rather then creating a massive table containing these values, I have stored them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343577 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Storing Arrays or Structures in a database
Another way to do it is to serialize the object in a base64 string. I've had some great success using this method to persist complex objects to the database. cfscript function serializeObject(object){ var local = structNew(); local.byteOut = createObject(java, java.io.ByteArrayOutputStream); local.byteOut.init(); local.objOut= createObject(java, java.io.ObjectOutputStream); local.objOut.init(local.byteOut); local.objOut.writeObject(arguments.object); local.objOut.close(); return toBase64(local.byteOut.toByteArray()); } function deserializeObject(objectString){ var local = structNew(); local.inputStream = createObject(java, java.io.ByteArrayInputStream); local.objIn = createObject(java, java.io.ObjectInputStream); local.returnObj = ; local.inputStream.init(toBinary(arguments.objectString)); local.objIn.init(local.inputStream); local.returnObj = local.objIn.readObject(); local.objIn.close(); return local.returnObj; } /cfscript I've been using this in http://sessionswap.riaforge.org/ for a long time. John Blayter Land line: 303.731.3009 Mobile: 303.325.1979 http://www.blayter.com/john/ Denver ColdFusion User Group Manager http://denvercfug.org/ On Wed, Apr 6, 2011 at 12:02 PM, Jeff Garza j...@garzasixpack.com wrote: Arrays are easy as you can simply use Arraytolist() to convert it to a delimited text string and then use ListtoArray() to convert back once you get it out. Though, CF has some really nice list functions, so you might not even have to do that. Also, select boxes return comma separated lists back to CF when a form is submitted (ditto for checkboxes with the same name)... So that might work in your favor. For structures though, WDDX is your friend, and quite easy to do... Try cfwddx action=CFML2WDDX input=#workweek# output=workweekXML Then stuff workweekXML into the database field. When you retrieve the data back out of the database, use cfwddx again to convert back to a CF structure cfwddx action=WDDX2CFML input=queryname.databaseWDDXField output=localStructVariable Just make sure that your db field can handle a decent sized chunk of data, especially if you are allowing user defined data in this column as the WDDX format can get kinda bloated. -Original Message- From: Adam Bourg [mailto:adam.bo...@gmail.com] Sent: Wednesday, April 06, 2011 10:41 AM To: cf-talk Subject: Storing Arrays or Structures in a database I've got really large sets of data that are related to each day of the week and the hour. Rather then creating a massive table containing these values, I have stored them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343580 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Storing Arrays or Structures in a database
Just talked about this today with a colleague. Convert it to JSON and store that. When you need to use it, get it from the database and deseralize it. .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com -Original Message- From: Adam Bourg [mailto:adam.bo...@gmail.com] Sent: Wednesday, April 06, 2011 1:41 PM To: cf-talk Subject: Storing Arrays or Structures in a database I've got really large sets of data that are related to each day of the week and the hour. Rather then creating a massive table containing these values, I have stored them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343584 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Storing Arrays or Structures in a database
Assuming you are dealing with one dimensional arrays, sure, converting it to a list could work. .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com -Original Message- From: Jeff Garza [mailto:j...@garzasixpack.com] Sent: Wednesday, April 06, 2011 2:02 PM To: cf-talk Subject: RE: Storing Arrays or Structures in a database Arrays are easy as you can simply use Arraytolist() to convert it to a delimited text string and then use ListtoArray() to convert back once you get it out. Though, CF has some really nice list functions, so you might not even have to do that. Also, select boxes return comma separated lists back to CF when a form is submitted (ditto for checkboxes with the same name)... So that might work in your favor. For structures though, WDDX is your friend, and quite easy to do... Try cfwddx action=CFML2WDDX input=#workweek# output=workweekXML Then stuff workweekXML into the database field. When you retrieve the data back out of the database, use cfwddx again to convert back to a CF structure cfwddx action=WDDX2CFML input=queryname.databaseWDDXField output=localStructVariable Just make sure that your db field can handle a decent sized chunk of data, especially if you are allowing user defined data in this column as the WDDX format can get kinda bloated. -Original Message- From: Adam Bourg [mailto:adam.bo...@gmail.com] Sent: Wednesday, April 06, 2011 10:41 AM To: cf-talk Subject: Storing Arrays or Structures in a database I've got really large sets of data that are related to each day of the week and the hour. Rather then creating a massive table containing these values, I have stored them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343585 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Storing Arrays or Structures in a database
True. I used wddx to serialize some multidimensional arrays just the other day... Jeff -Original Message- From: Bobby Hartsfield [mailto:bo...@acoderslife.com] Sent: Wednesday, April 06, 2011 2:39 PM To: cf-talk Subject: RE: Storing Arrays or Structures in a database Assuming you are dealing with one dimensional arrays, sure, converting it to a list could work. .:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com -Original Message- From: Jeff Garza [mailto:j...@garzasixpack.com] Sent: Wednesday, April 06, 2011 2:02 PM To: cf-talk Subject: RE: Storing Arrays or Structures in a database Arrays are easy as you can simply use Arraytolist() to convert it to a delimited text string and then use ListtoArray() to convert back once you get it out. Though, CF has some really nice list functions, so you might not even have to do that. Also, select boxes return comma separated lists back to CF when a form is submitted (ditto for checkboxes with the same name)... So that might work in your favor. For structures though, WDDX is your friend, and quite easy to do... Try cfwddx action=CFML2WDDX input=#workweek# output=workweekXML Then stuff workweekXML into the database field. When you retrieve the data back out of the database, use cfwddx again to convert back to a CF structure cfwddx action=WDDX2CFML input=queryname.databaseWDDXField output=localStructVariable Just make sure that your db field can handle a decent sized chunk of data, especially if you are allowing user defined data in this column as the WDDX format can get kinda bloated. -Original Message- From: Adam Bourg [mailto:adam.bo...@gmail.com] Sent: Wednesday, April 06, 2011 10:41 AM To: cf-talk Subject: Storing Arrays or Structures in a database I've got really large sets of data that are related to each day of the week and the hour. Rather then creating a massive table containing these values, I have stored them in a Structure, but I can't seem to get Structures or Arrays to insert into a database. How can I store an array or structure in a MS 2008 SQL server? Array Code: cfset name=Adam / cfscript // 7 days, day 0 = Mon, Day 7 = sun workWeek=[t,t,f,t,f,t,f]; /cfscript cfinvoke method=injectData component=anubis cfinvokeargument name=name value=#name# / cfinvokeargument name=workWeek value=#workWeek# / /cfinvoke cffunction name=injectData access=public returntype=void hint=Injects the Employee App form data cfquery datasource=DSN name=insertData INSERT INTO mod_employmentAppProfile( name, workWeekendsEvenings ) VALUES ( #ARGUMENTS.name#, #ARGUMENTS.workWeek# ) /cfquery ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343586 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Storing Arrays or Structures in a database
If anyone is on ColdFusion 8+ then instead of wddx one might use Json instead, as it has a smaller footprint than WDDX does. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Jeff Garza [mailto:j...@garzasixpack.com] Sent: Thursday, 7 April 2011 8:10 AM To: cf-talk Subject: RE: Storing Arrays or Structures in a database True. I used wddx to serialize some multidimensional arrays just the other day... Jeff ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343587 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Storing Arrays or Structures in a database
And you can pass it back and forth between cf and js with no fuss or muss. On Wed, Apr 6, 2011 at 6:09 PM, Andrew Scott andr...@andyscott.id.auwrote: If anyone is on ColdFusion 8+ then instead of wddx one might use Json instead, as it has a smaller footprint than WDDX does. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Jeff Garza [mailto:j...@garzasixpack.com] Sent: Thursday, 7 April 2011 8:10 AM To: cf-talk Subject: RE: Storing Arrays or Structures in a database True. I used wddx to serialize some multidimensional arrays just the other day... Jeff ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343588 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Storing Arrays or Structures in a database
On Wed, Apr 6, 2011 at 5:54 PM, Michael Grant wrote: And you can pass it back and forth between cf and js with no fuss or muss. Well, besides the weird is it a string or a number type of deal that can change 8 to 8.0 and a few other oddities. ;) :Den -- It is easier to make a saint out of a libertine than out of a prig. George Santayana ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343589 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Storing Arrays or Structures in a database
Well I prefer the json.cfc that has been floating around for a while, it doesn't suffer those problems. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: denstar [mailto:valliants...@gmail.com] Sent: Thursday, 7 April 2011 10:12 AM To: cf-talk Subject: Re: Storing Arrays or Structures in a database Well, besides the weird is it a string or a number type of deal that can change 8 to 8.0 and a few other oddities. ;) :Den -- ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343590 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Storing Arrays or Structures in a database
Given. I have a tendency to always use parseInt anyway, so I don't generally suffer that woe. However your point is well taken... a teeny bit of fuss, with a pinch of muss. On Wed, Apr 6, 2011 at 8:12 PM, denstar valliants...@gmail.com wrote: On Wed, Apr 6, 2011 at 5:54 PM, Michael Grant wrote: And you can pass it back and forth between cf and js with no fuss or muss. Well, besides the weird is it a string or a number type of deal that can change 8 to 8.0 and a few other oddities. ;) :Den -- It is easier to make a saint out of a libertine than out of a prig. George Santayana ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343591 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Storing Arrays or Structures in a database
I was mostly just being pedantic. :) It works fine out of the box most the time. And for the rest of the time, there's json.cfc, as Andrew mentioned. :) No joke that it's way better than WDDX. Three cheers for JSON! Hip, hip, hip! :den the pelvis uno -- It is veneer, rouge, aestheticism, art museums, new theaters, etc. that make America impotent. The good things are football, kindness, and jazz bands. George Santayana On Wed, Apr 6, 2011 at 6:33 PM, Michael Grant wrote: Given. I have a tendency to always use parseInt anyway, so I don't generally suffer that woe. However your point is well taken... a teeny bit of fuss, with a pinch of muss. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343592 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Looping through arrays with structures
Thanks all. That was very helpful. Here's the code I ended up using. cfloop from=1 to=#arrayLen(keyword_results)# index=x cfloop from=1 to=#arrayLen(keyword_results[x].images)# index=y cfoutput#keyword_results[x].images[y]#/cfoutput /cfloop /cfloop ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337280 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Looping through arrays with structures
I thought images was a structure containing an array? On Tue, Sep 21, 2010 at 5:15 PM, Richard Steele r...@photoeye.com wrote: Thanks all. That was very helpful. Here's the code I ended up using. cfloop from=1 to=#arrayLen(keyword_results)# index=x cfloop from=1 to=#arrayLen(keyword_results[x].images)# index=y cfoutput#keyword_results[x].images[y]#/cfoutput /cfloop /cfloop ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337289 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Looping through arrays with structures
No worries. An honest mistake. I've actually never used the Array attribute since I've been looping this way for 10 years. And unless it's inherently faster (which I doubt) I suspect I never will. I actually prefer my loops to use an int as the index. That was I've always got an easily available currentrow-like variable. On Fri, Sep 17, 2010 at 11:25 PM, Andrew Scott andr...@andyscott.id.auwrote: Hehe, I doubt you are blind at all. I swear I actually read it as using the Array attribute, oh well let me get my eyes checked. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Jacob Munson [mailto:yacoub...@gmail.com] Sent: Saturday, 18 September 2010 12:54 PM To: cf-talk Subject: Re: Looping through arrays with structures Am I blind? The email I read from Michael does NOT show the array attribute. In fact, his loop looks exactly like your code. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337208 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Looping through arrays with structures
I have an array with a structure that has an array. How do I loop through this in CF8 and retrieve the second array's 5 digit numbers? Thanks in advance. array 1 | | struct | IMAGES | | | array | | 1 | 18990 | | 2 | 8 | | 3 | 39209 | | ID | 13763 ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337198 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Looping through arrays with structures
cfloop from=1 to=#arrayLen(firstArray)# index=x cfloop from=1 to=#arrayLen(firstArray[x].images.secondArray)# index=y cfoutput#firstArray[x].images.secondArray[y]#/cfoutput /cfloop /cfloop On Fri, Sep 17, 2010 at 8:18 PM, Richard Steele r...@photoeye.com wrote: I have an array with a structure that has an array. How do I loop through this in CF8 and retrieve the second array's 5 digit numbers? Thanks in advance. array 1 | | struct | IMAGES | | | array | | 1 | 18990 | | 2 | 8 | | 3 | 39209 | | ID | 13763 ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337199 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Looping through arrays with structures
That won't work in certain versions of ColdFusion, if you are not using the version of ColdFusion that supports this. You can do a normal cfloop from and to and use the indexing of the array in this manner cfloop from=1 to=#ArratLen(myArray)# index=arrayCounter myArray[arrayCounter].images /cfloop Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Saturday, 18 September 2010 10:35 AM To: cf-talk Subject: Re: Looping through arrays with structures cfloop from=1 to=#arrayLen(firstArray)# index=x cfloop from=1 to=#arrayLen(firstArray[x].images.secondArray)# index=y cfoutput#firstArray[x].images.secondArray[y]#/cfoutput /cfloop /cfloop ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337200 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Looping through arrays with structures
What version of cf won't my code work in? On Fri, Sep 17, 2010 at 8:42 PM, Andrew Scott andr...@andyscott.id.auwrote: That won't work in certain versions of ColdFusion, if you are not using the version of ColdFusion that supports this. You can do a normal cfloop from and to and use the indexing of the array in this manner cfloop from=1 to=#ArratLen(myArray)# index=arrayCounter myArray[arrayCounter].images /cfloop Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Saturday, 18 September 2010 10:35 AM To: cf-talk Subject: Re: Looping through arrays with structures cfloop from=1 to=#arrayLen(firstArray)# index=x cfloop from=1 to=#arrayLen(firstArray[x].images.secondArray)# index=y cfoutput#firstArray[x].images.secondArray[y]#/cfoutput /cfloop /cfloop ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337201 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Looping through arrays with structures
You can't be serious asking that sort of question, the array Attribute was introduced in ColdFusion 8. So that means people who are still running ColdFusion 5 - 7 will not be able to use that code. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Saturday, 18 September 2010 11:09 AM To: cf-talk Subject: Re: Looping through arrays with structures What version of cf won't my code work in? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337203 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Looping through arrays with structures
Am I blind? The email I read from Michael does NOT show the array attribute. In fact, his loop looks exactly like your code. On Fri, Sep 17, 2010 at 6:42 PM, Andrew Scott andr...@andyscott.id.auwrote: That won't work in certain versions of ColdFusion, if you are not using the version of ColdFusion that supports this. You can do a normal cfloop from and to and use the indexing of the array in this manner cfloop from=1 to=#ArratLen(myArray)# index=arrayCounter myArray[arrayCounter].images /cfloop Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Saturday, 18 September 2010 10:35 AM To: cf-talk Subject: Re: Looping through arrays with structures cfloop from=1 to=#arrayLen(firstArray)# index=x cfloop from=1 to=#arrayLen(firstArray[x].images.secondArray)# index=y cfoutput#firstArray[x].images.secondArray[y]#/cfoutput /cfloop /cfloop ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337204 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Looping through arrays with structures
He didn't use the array attribute. He used the exact same index loop that you did (from=1 to=#arrayLen(myArray)#). On Fri, Sep 17, 2010 at 6:56 PM, Andrew Scott andr...@andyscott.id.auwrote: You can't be serious asking that sort of question, the array Attribute was introduced in ColdFusion 8. So that means people who are still running ColdFusion 5 - 7 will not be able to use that code. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Saturday, 18 September 2010 11:09 AM To: cf-talk Subject: Re: Looping through arrays with structures What version of cf won't my code work in? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337205 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Looping through arrays with structures
Hehe, I doubt you are blind at all. I swear I actually read it as using the Array attribute, oh well let me get my eyes checked. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Jacob Munson [mailto:yacoub...@gmail.com] Sent: Saturday, 18 September 2010 12:54 PM To: cf-talk Subject: Re: Looping through arrays with structures Am I blind? The email I read from Michael does NOT show the array attribute. In fact, his loop looks exactly like your code. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337206 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Append Arrays with Structures
I am trying to add my Pagelist to the array .. using structure. I am using structure to add everytime pagelist to an array so that I can display my list of pages updated or inserted on every user session. This is wat I am using... cfparam name=session.pageList default=arrayNew() !--- Append a new element to the array. This element is a new structure. --- cfset session.pageList = arrayAppend( session.pageList, structNew() ) !--- Set up a variable to hold the array position that we're inserting into. --- cfset NumberPage = arraylen(session.PageList) !--- Populate the new structure with the item information passed from the form. --- cfset session.cart[NumberPage].PageListInfo = session.page cfloop index=NumberPage from=1 to=#arraylen(sesson.item)# cfset session.item[NumberPage].PageListInfo = session.page /cfloop I get an error: Object of type class java.lang.String cannot be used as an array Can anyone Help with this Thanks, Priya ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320351 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Append Arrays with Structures
ArrayAppend does not return the array - it returns True, on successful completion. (http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentationfile=0381.htm) So: cfparam name=session.pageList default=#arrayNew(1)# / cfset arrayAppend( session.pageList, structNew() ) / ... etc. Dominic !--- Set up a variable to hold the array position that we're inserting into. --- cfset NumberPage = arraylen(session.PageList) !--- Populate the new structure with the item information passed from the form. --- cfset session.cart[NumberPage].PageListInfo = session.page cfloop index=NumberPage from=1 to=#arraylen(sesson.item)# cfset session.item[NumberPage].PageListInfo = session.page /cfloop 2009/3/11 Priya Koya priya23...@gmail.com: I am trying to add my Pagelist to the array .. using structure. I am using structure to add everytime pagelist to an array so that I can display my list of pages updated or inserted on every user session. This is wat I am using... cfparam name=session.pageList default=arrayNew() !--- Append a new element to the array. This element is a new structure. --- cfset session.pageList = arrayAppend( session.pageList, structNew() ) !--- Set up a variable to hold the array position that we're inserting into. --- cfset NumberPage = arraylen(session.PageList) !--- Populate the new structure with the item information passed from the form. --- cfset session.cart[NumberPage].PageListInfo = session.page cfloop index=NumberPage from=1 to=#arraylen(sesson.item)# cfset session.item[NumberPage].PageListInfo = session.page /cfloop I get an error: Object of type class java.lang.String cannot be used as an array Can anyone Help with this Thanks, Priya ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320352 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Append Arrays with Structures
You're setting the value of session.pageList to the string arrayNew(), which is throwing your error. If you're using cfparam then you need the # signs and to create an array you need to specify the number of dimensions (in this case 1): cfparam name=session.pageList default=#arrayNew(1)# / If this is not in a loop or something, you could just set directly: cfset session.pageList = arrayNew(1) / ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320357 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Append Arrays with Structures
Jason Fisher wrote: If you're using cfparam then you need the # signs Or get rid of the quotes. cfparam name=session.pageList default=#arrayNew(1)# / I.E. This also works. cfparam name=session.pageList default = arrayNew(1) / !--- note the lack of quotes in the default parameter --- ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320358 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Append Arrays with Structures
I am getting an error here: *session.pageList = arrayAppend( session.pageList, structNew() ) * Error: Object of type class java.lang.Boolean cannot be used as an array On Wed, Mar 11, 2009 at 9:55 AM, Jason Fisher ja...@wanax.com wrote: You're setting the value of session.pageList to the string arrayNew(), which is throwing your error. If you're using cfparam then you need the # signs and to create an array you need to specify the number of dimensions (in this case 1): cfparam name=session.pageList default=#arrayNew(1)# / If this is not in a loop or something, you could just set directly: cfset session.pageList = arrayNew(1) / ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320359 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Append Arrays with Structures
As Dominic pointed out above, just do: cfset arrayAppend( session.pageList, structNew() ) / ArrayAppend() returns true / false, not an array. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320360 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Append Arrays with Structures
yes, as jason pinted out, arrayappend() function differs from listappend() - with arrayappend() one should not set the array to the function's return: with arrayappend: cfset arrayappend(arrayvar, value_to_append) but with listappend() one has to do: cfset prev_defined_list_var = listappend(prev_defined_list_var, new_value_to_append) Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ Priya Koya wrote: I am getting an error here: *session.pageList = arrayAppend( session.pageList, structNew() ) * Error: Object of type class java.lang.Boolean cannot be used as an array On Wed, Mar 11, 2009 at 9:55 AM, Jason Fisher ja...@wanax.com wrote: You're setting the value of session.pageList to the string arrayNew(), which is throwing your error. If you're using cfparam then you need the # signs and to create an array you need to specify the number of dimensions (in this case 1): cfparam name=session.pageList default=#arrayNew(1)# / If this is not in a loop or something, you could just set directly: cfset session.pageList = arrayNew(1) / ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320362 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Append Arrays with Structures
Priya Koya wrote: I am getting an error here: *session.pageList = arrayAppend( session.pageList, structNew() ) * Error: Object of type class java.lang.Boolean cannot be used as an array On Wed, Mar 11, 2009 at 9:55 AM, Jason Fisher ja...@wanax.com wrote: As Dominic previously stated, arrayAppend() returns a boolean value. The first time you run that line you are overwriting your array and turning it into an array, then the next loop iteration throws an error because session.pageList is now a boolean. Drop the left side of the line. cfset arrayAppend(session.pageList ,structNew()) ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320363 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Append Arrays with Structures
Jason, cfparam name=session.pageList default= arrayNew(1) cfparam name=session.pageList default=#arrayNew(1)# cfparam name=session.pageList default=#arrayNew(1)# cfparam name=session.pageList default=arrayNew(1) cfparam name=session.pageList default=#arrayNew(1)# nothing works I tried with : On Wed, Mar 11, 2009 at 9:16 AM, Ian Skinner h...@ilsweb.com wrote: Jason Fisher wrote: If you're using cfparam then you need the # signs Or get rid of the quotes. cfparam name=session.pageList default=#arrayNew(1)# / I.E. This also works. cfparam name=session.pageList default = arrayNew(1) / !--- note the lack of quotes in the default parameter --- ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320365 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Append Arrays with Structures
Ian Skinner wrote: The first time you run that line you are overwriting your array and turning it into an array... The first time you run that line you are overwriting your array and turning it into an *boolean* ... That would make more sense, wouldn't it. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320367 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Append Arrays with Structures
Priya Koya wrote: nothing works That is because the cfparam... tag is not your problem. Your problem is that in the loop, the first iteration changes your array into a boolean. Then the second iteration throws an error because you try to use that boolean variable as an array. See the five posts to this effect. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320368 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Append Arrays with Structures
Out of interest, I wonder what would have to happen for ArrayAppend to return false?! Adrian -Original Message- From: Dominic Watson [mailto:watson.domi...@googlemail.com] Sent: 11 March 2009 12:37 To: cf-talk Subject: Re: Append Arrays with Structures ArrayAppend does not return the array - it returns True, on successful completion. (http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/ html/wwhelp.htm?context=ColdFusion_Documentationfile=0381.htm) So: cfparam name=session.pageList default=#arrayNew(1)# / cfset arrayAppend( session.pageList, structNew() ) / ... etc. Dominic ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320373 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Append Arrays with Structures
Is this right? cfset myarray = arrayNew(1) cfset session.pageList = arrayAppend( myarray, structNew() ) cfset NumberPage = arraylen(session.PageList) for finding out he arraylen?? because this is where it is giving me the error.. On Wed, Mar 11, 2009 at 10:21 AM, Adrian Lynch cont...@adrianlynch.co.ukwrote: Out of interest, I wonder what would have to happen for ArrayAppend to return false?! Adrian -Original Message- From: Dominic Watson [mailto:watson.domi...@googlemail.com] Sent: 11 March 2009 12:37 To: cf-talk Subject: Re: Append Arrays with Structures ArrayAppend does not return the array - it returns True, on successful completion. (http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/ html/wwhelp.htm?context=ColdFusion_Documentationfile=0381.htm) So: cfparam name=session.pageList default=#arrayNew(1)# / cfset arrayAppend( session.pageList, structNew() ) / ... etc. Dominic ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320375 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Append Arrays with Structures
it's been said over and over in this thread. arrayAppend() returns a boolean. if you do cfset session.pageList = arrayAppend(myArray, structNew()) /, you're essentially setting the value of session.pageList to true. Then, when you try to run an array function on session.pageList, you get the error because it's not an array. it's a boolean whose value is true. read thru the replies and you'll see. you're asking for help and people are trying to give it to you, but you don't seem to want to take it. cfset arrayAppend(myArray, structNew()) /. that will fix your problems. On Wed, Mar 11, 2009 at 8:48 AM, Priya Koya priya23...@gmail.com wrote: Is this right? cfset myarray = arrayNew(1) cfset session.pageList = arrayAppend( myarray, structNew() ) cfset NumberPage = arraylen(session.PageList) for finding out he arraylen?? because this is where it is giving me the error.. On Wed, Mar 11, 2009 at 10:21 AM, Adrian Lynch cont...@adrianlynch.co.uk wrote: Out of interest, I wonder what would have to happen for ArrayAppend to return false?! Adrian -Original Message- From: Dominic Watson [mailto:watson.domi...@googlemail.com] Sent: 11 March 2009 12:37 To: cf-talk Subject: Re: Append Arrays with Structures ArrayAppend does not return the array - it returns True, on successful completion. ( http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/ html/wwhelp.htm?context=ColdFusion_Documentationfile=0381.htm) So: cfparam name=session.pageList default=#arrayNew(1)# / cfset arrayAppend( session.pageList, structNew() ) / ... etc. Dominic ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320376 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Append Arrays with Structures
Priya Koya wrote: Is this right? cfset myarray = arrayNew(1) cfset session.pageList = arrayAppend( myarray, structNew() ) cfset NumberPage = arraylen(session.PageList) for finding out he arraylen?? because this is where it is giving me the error.. Yes, it was, Charlie just explained this again for you. cfset arrayAppend(session.pageList, structNew() would solve the problems you have told us about. But just for another tact, I will also correct this latest code example. cfset myArray = arrayNew(1) cfset session.pageList = arrayAppend ( myArray, structNew() ) !--- this is an acceptable line, but session.pageList is basically a meaningless variable and almost nobody bothers with it --- cfset NumberPage = arrayLen(myArray) !--- see how the arrayAppend() function modified the array used in the parameter --- ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320378 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Append Arrays with Structures
@Adrian, Interesting question ... can't really think of anything off-hand. From: Adrian Lynch cont...@adrianlynch.co.uk Sent: Wednesday, March 11, 2009 11:25 AM To: cf-talk cf-talk@houseoffusion.com Subject: RE: Append Arrays with Structures Out of interest, I wonder what would have to happen for ArrayAppend to return false?! Adrian ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320382 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Append Arrays with Structures
I don't believe that it ever does return false and the docs do not indicate that it does. Indeed, it is almost certainly using the add method of the java AbstractList object (from which it inherits). This states that it returns true only. If there is an error, an exception is thrown. http://java.sun.com/j2se/1.4.2/docs/api/java/util/AbstractList.html#add(java.lang.Object) Dominic 2009/3/11 Jason Fisher ja...@wanax.com: @Adrian, Interesting question ... can't really think of anything off-hand. From: Adrian Lynch cont...@adrianlynch.co.uk Sent: Wednesday, March 11, 2009 11:25 AM To: cf-talk cf-talk@houseoffusion.com Subject: RE: Append Arrays with Structures Out of interest, I wonder what would have to happen for ArrayAppend to return false?! Adrian ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320383 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Append Arrays with Structures
Thanks for the info, Dominic. Seems like that shouldn't make sense ... a Boolean that has no 'off' state, yet it perfectly makes sense that only an exception could be 'false' and exceptions need to be thrown, not simply reported as 'false'. Thanks! Jason ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320384 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Append Arrays with Structures
Seems like that shouldn't make sense ... a Boolean that has no 'off' state Nowhere states that the function returns a boolean ;) But it is odd, indeed, why return anything at all. I've done it myself in functions and justified it with 'One day I may have some logic that returns false and then the calling code that is checking for the boolean wont break. Dominic ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320389 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Append Arrays with Structures
But it is odd, indeed, why return anything at all. It depends on the class. Some use it and some do not http://java.sun.com/j2se/1.4.2/docs/api/java/util/AbstractCollection.html#add(java.lang.Object) I don't believe that it ever does return false and the docs do not indicate that it does. Indeed, it is almost certainly using the add method of the java AbstractList object (from which it inherits). This states that it returns true only. If there is an error, an exception is thrown. It may not be due to the java link. I found a reference that says ArrayAppend returned a boolean back in the days of CF 4.5. So it may just be a carry over. Though ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320391 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Append Arrays with Structures
All speculation (though I'm sure someone here knows the answer for sure) but: It may not be due to the java link. I found a reference that says ArrayAppend returned a boolean back in the days of CF 4.5. So it may just be a carry over. This would suggest that it *would* be to do with the java link; ColdFusion 4.5 was written in C++ ;) Dominic ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320400 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Append Arrays with Structures
Nowhere states that the function returns a boolean ;) But it is odd, indeed, why return anything at all. I've done it myself in functions and justified it with 'One day I may have some logic that returns false and then the calling code that is checking for the boolean wont break. CF functions have traditionally returned a Boolean value even when this value doesn't indicate anything meaningful. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320402 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Append Arrays with Structures
It may not be due to the java link. I found a reference that says ArrayAppend returned a boolean back in the days of CF 4.5. So it may just be a carry over. This would suggest that it *would* be to do with the java link; ColdFusion 4.5 was written in C++ ;) No, I just meant that the function returning a boolean at all probably had nothing to do with the java link. Not that it could not hook into java's behavior if it wanted to ... ;-) But Dave's explanation sounds pretty plausible to me. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320410 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Append Arrays with Structures
Ah, we are at cross wires! I was citing the java method as a possible reason for the function only ever returning true (or my suspicion that it never returns false, in response to Adrian's question) - not for it returning a boolean (which of course it does). Perhaps pre-6 it did sometimes return false, though as David points out, CF has traditionally followed this pattern so quite probably not. The docs may have changed their wording to reflect the wording in the javadocs, if indeed that is the method that is being used. Anyways, I wonder if the OP has found his solution yet ;) Dominic 2009/3/11 C S cfsearch...@yahoo.com: No, I just meant that the function returning a boolean at all probably had nothing to do with the java link. Not that it could not hook into java's behavior if it wanted to ... ;-) But Dave's explanation sounds pretty plausible to m ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320416 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Append Arrays with Structures
Ah, we are at cross wires! Well that makes a lot more sense. That is what I get for only reading half of the thread ... Anyways, I wonder if the OP has found his solution yet ;) Wait .. there was an OP? ;-) ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320419 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Append Arrays with Structures
*beats head on desk* mxAjax / CFAjax docs and other useful articles: http://www.bifrost.com.au/blog/ 2009/3/12 Priya Koya priya23...@gmail.com: Is this right? cfset myarray = arrayNew(1) cfset session.pageList = arrayAppend( myarray, structNew() ) ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320423 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
CF Structures.. brain fried
I've got a query that returns two fields for each record (id, name). There can be several records returned Because of the way that the site is set up I need to dump the results into the session scope and then loop over them on an output page I think I over complicated it by using Ben Nadel's QueryToStruct script. Is there a simple way to do this? -- Scott Stewart ColdFusion Developer 4405 Oakshyre Way Raleigh, NC 27616 (h) 919.874.6229 (c) 703.220.2835 ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320295 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CF Structures.. brain fried
not seeing the need to convert the query to a struct. cfset session.myQuery = myQuery / cfoutput query=session.myQuery #session.myQuery.ID# #session.myQuery.name#br / (or, if you don't want to fully qualify the names...) #ID# #name#br / /cfoutput depending on how your app is structured, you may need to do some checking before placing the query into the session. maybe something like: cfif not structKeyExists(session, 'myQuery') cfset session.myQuery = myQuery / /cfif On Mon, Mar 9, 2009 at 11:33 AM, Scott Stewart sstwebwo...@bellsouth.netwrote: I've got a query that returns two fields for each record (id, name). There can be several records returned Because of the way that the site is set up I need to dump the results into the session scope and then loop over them on an output page I think I over complicated it by using Ben Nadel's QueryToStruct script. Is there a simple way to do this? -- Scott Stewart ColdFusion Developer 4405 Oakshyre Way Raleigh, NC 27616 (h) 919.874.6229 (c) 703.220.2835 ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320297 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: CF Structures.. brain fried
Probably you can just assign the query to a session variable: cfset session.myQuery = myQuery / Then output the query: cfoutput query=session.myQuery !--- do stuff --- /cfoutput You don't need to change the query itself into structures. -- Josh -Original Message- From: Scott Stewart [mailto:sstwebwo...@bellsouth.net] Sent: Monday, March 09, 2009 11:33 AM To: cf-talk Subject: CF Structures.. brain fried I've got a query that returns two fields for each record (id, name). There can be several records returned Because of the way that the site is set up I need to dump the results into the session scope and then loop over them on an output page I think I over complicated it by using Ben Nadel's QueryToStruct script. Is there a simple way to do this? -- Scott Stewart ColdFusion Developer 4405 Oakshyre Way Raleigh, NC 27616 (h) 919.874.6229 (c) 703.220.2835 ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320298 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: CF Structures.. brain fried
Charlie, Josh This worked perfectly... I didn't know that you just dump the query into the session scope Thanks a million sas -- Scott Stewart ColdFusion Developer 4405 Oakshyre Way Raleigh, NC 27616 (h) 919.874.6229 (c) 703.220.2835 -Original Message- From: Charlie Griefer [mailto:charlie.grie...@gmail.com] Sent: Monday, March 09, 2009 2:40 PM To: cf-talk Subject: Re: CF Structures.. brain fried not seeing the need to convert the query to a struct. cfset session.myQuery = myQuery / cfoutput query=session.myQuery #session.myQuery.ID# #session.myQuery.name#br / (or, if you don't want to fully qualify the names...) #ID# #name#br / /cfoutput depending on how your app is structured, you may need to do some checking before placing the query into the session. maybe something like: cfif not structKeyExists(session, 'myQuery') cfset session.myQuery = myQuery / /cfif On Mon, Mar 9, 2009 at 11:33 AM, Scott Stewart sstwebwo...@bellsouth.netwrote: I've got a query that returns two fields for each record (id, name). There can be several records returned Because of the way that the site is set up I need to dump the results into the session scope and then loop over them on an output page I think I over complicated it by using Ben Nadel's QueryToStruct script. Is there a simple way to do this? -- Scott Stewart ColdFusion Developer 4405 Oakshyre Way Raleigh, NC 27616 (h) 919.874.6229 (c) 703.220.2835 ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320299 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CF Structures.. brain fried
Scott Stewart wrote: Charlie, Josh This worked perfectly... I didn't know that you just dump the query into the session scope You can dump anything into the session scope. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320301 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: CF Structures.. brain fried
Scott Stewart wrote: Charlie, Josh This worked perfectly... I didn't know that you just dump the query into the session scope You can dump anything into the session scope. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320303 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
function for getting a structures column names?
Hi does anyone know if there is a function to get the column / header names of a structure? thanks ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:303350 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: function for getting a structures column names?
They are known as keys and the built in ColdFusion functions are: StructKeyArray() and StructKeyList() HTH Dominic On 14/04/2008, Richard White [EMAIL PROTECTED] wrote: Hi does anyone know if there is a function to get the column / header names of a structure? thanks ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:303351 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: function for getting a structures column names?
thanks dominic, i had tried this and it came out with the values instead so i thought they were meant for something else. i then realised that i had an array of structures and was passing it the top level instead of an individual level, thanks for your help ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:303356 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: structures
Simplest thing to do is #session.questionDetails[1]['#currentID#']# -Original Message- From: Richard White [mailto:[EMAIL PROTECTED] Sent: Saturday, February 02, 2008 5:04 AM To: CF-Talk Subject: structures Hi, i can reference a structure to get the value no problem like this: cfoutput#session.questionDetails[1].subjectID#/cfoutput but i need to be able to get data out without physically knowing the name of the element, as a simple example i am trying to do it like this: cfset currentID = subjectID cfoutput#session.questionDetails[1][currentID]#/cfoutput the error says that it cannot convert complex objects to simple values. this is the same even if i try it like this: cfoutput#session.questionDetails[1][subjectID]#/cfoutput can anyone help me realise what i am doing wrong. thanks very much ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298051 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
structures
Hi, i can reference a structure to get the value no problem like this: cfoutput#session.questionDetails[1].subjectID#/cfoutput but i need to be able to get data out without physically knowing the name of the element, as a simple example i am trying to do it like this: cfset currentID = subjectID cfoutput#session.questionDetails[1][currentID]#/cfoutput the error says that it cannot convert complex objects to simple values. this is the same even if i try it like this: cfoutput#session.questionDetails[1][subjectID]#/cfoutput can anyone help me realise what i am doing wrong. thanks very much ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297989 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: structures
What do you get if you CFDUMP the value of #session.questionDetails[1][currentID]# instead? On Feb 2, 2008 8:04 PM, Richard White [EMAIL PROTECTED] wrote: Hi, i can reference a structure to get the value no problem like this: cfoutput#session.questionDetails[1].subjectID#/cfoutput but i need to be able to get data out without physically knowing the name of the element, as a simple example i am trying to do it like this: cfset currentID = subjectID cfoutput#session.questionDetails[1][currentID]#/cfoutput the error says that it cannot convert complex objects to simple values. this is the same even if i try it like this: cfoutput#session.questionDetails[1][subjectID]#/cfoutput can anyone help me realise what i am doing wrong. thanks very much ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297991 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: structures
Hi James, good idea!!! i cfdumped it and it did output only 1 value e.g. '44' - the contents they are supposed to be so im not sure why it is saying that it is a complex data type thanks James ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297995 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: structures
Hi James, good idea!!! i cfdumped it and it did output only 1 value e.g. '44' - the contents they are supposed to be so im not sure why it is saying that it is a complex data type thanks James ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297996 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: structures
That looks right. Maybe something else is happening. Is there any more code to show? Here's some sample code to show that what you're after should work... cfscript st = StructNew(); st.a = A; a = a; /cfscript cfoutput p#st.a#/p hr / p#st[a]#/p hr / p#st[a]#/p /cfoutput hr /hr / cfscript ar = ArrayNew(1); ar[1] = StructNew(); ar[1].a = A; a = a; /cfscript cfoutput p#ar[1].a#/p hr / p#ar[1][a]#/p hr / p#ar[1][a]#/p /cfoutput You're not use shorthand to create any of the data collections are you? Like a = [1,2,3]? Adrian -Original Message- From: Richard White Sent: 02 February 2008 11:04 To: CF-Talk Subject: structures Hi, i can reference a structure to get the value no problem like this: cfoutput#session.questionDetails[1].subjectID#/cfoutput but i need to be able to get data out without physically knowing the name of the element, as a simple example i am trying to do it like this: cfset currentID = subjectID cfoutput#session.questionDetails[1][currentID]#/cfoutput the error says that it cannot convert complex objects to simple values. this is the same even if i try it like this: cfoutput#session.questionDetails[1][subjectID]#/cfoutput can anyone help me realise what i am doing wrong. thanks very much ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297998 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: structures
Hi Adrian, you are absolutely right, i was creating the structure directly from a query, therefore even though the query is only returning 1 row it is still saving as a complex structure thanks very much, i have now sorted this out!!! thanks again ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298000 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Create a webservice to accept an array of structures/components
Goal: To create a webservice that can accept an array of structures/components. Problem: The webservice will not accept the array of structures/components passed to it. Code: 1) The following is the code that creates the array of structures/components and invokes the webservice. (Testws.cfm) cfoutput !--- Creat Test Game Object --- cfset arrGame = ArrayNew(1) cfloop index=i from=1 to=5 cfset arrGame[i] = CreateObject(component, gameTest) cfset arrGame[i].setGameID(ToString(i)) cfset arrGame[i].setHomeSSID(OHSSTEST i) /cfloop barrGame:/bbrcfdump var=#arrGame# cfinvoke webservice=http://dev.schedulestar.com/Tim/webservicetest.cfc?wsdl; method=complextype1 returnvariable=serviceResult Games=#arrGame# brbrbserviceResult:/bbrcfdump var=#serviceResult# /cfoutput 2) The following is the code for the web service (webservicetest.cfc) cfcomponent cffunction name=complextype1 returntype=gameTest[] access=remote cfargument name=Games type=gameTest[] required=yes cfset arrGame = arraynew(1) !--- Return Variable --- !--- Creat Game --- cfloop index=s from=1 to=#arraylen(Games)# cfset arrGame[s] = CreateObject(component, gameTest) cfset arrGame[s].setGameID(ToString(s)) cfset arrGame[s].setHomeSSID(Games[s].getHomeSSID) /cfloop cfreturn arrGame /cffunction /cfcomponent 3) The following is the component. An array of this component is made and passed to the webservice. (gameTest.cfc) cfcomponent cfproperty name=GameID type=string cfproperty name=HomeSSID type=string !--- Initialize --- cfscript this.GameID = 0; this.HomeSSID = ; /cfscript !--- Methods --- cffunction name=getGameID access=public returntype=string cfreturn this.GameID /cffunction cffunction name=setGameID access=public cfargument name=game type=string required=yes cfset this.GameID = game /cffunction cffunction name=getHomeSSID access=public returntype=string cfreturn this.HomeSSID /cffunction cffunction name=setHomeSSID access=public cfargument name=ssid type=string required=yes cfset this.HomeSSID = ssid /cffunction /cfcomponent Basically, the testWS.cfm file creates an array of the component and passes it to the webservice. No matter what I try to do, errors continue to be thrown. I believe the problem is in the code for the webservice. Thank you for your help. ~| Get the answers you are looking for on the ColdFusion Labs Forum direct from active programmers and developers. http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72catid=648 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292142 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Create a webservice to accept an array of structures/components
Hi Etwan, I think your problem is that gameTest[] is not a valid data type. It is the name of an array, but it is not a datatype. The datatype would simply be an array. This array holds multiple instances of the gameTest object, but still the datatype itself would simply be an array. Dean On 10/26/07, Etwan Sherdloo [EMAIL PROTECTED] wrote: Goal: To create a webservice that can accept an array of structures/components. Problem: The webservice will not accept the array of structures/components passed to it. Code: 1) The following is the code that creates the array of structures/components and invokes the webservice. (Testws.cfm) cfoutput !--- Creat Test Game Object --- cfset arrGame = ArrayNew(1) cfloop index=i from=1 to=5 cfset arrGame[i] = CreateObject(component, gameTest) cfset arrGame[i].setGameID(ToString(i)) cfset arrGame[i].setHomeSSID(OHSSTEST i) /cfloop barrGame:/bbrcfdump var=#arrGame# cfinvoke webservice=http://dev.schedulestar.com/Tim/webservicetest.cfc?wsdl; method=complextype1 returnvariable=serviceResult Games=#arrGame# brbrbserviceResult:/bbrcfdump var=#serviceResult# /cfoutput 2) The following is the code for the web service (webservicetest.cfc) cfcomponent cffunction name=complextype1 returntype=gameTest[] access=remote cfargument name=Games type=gameTest[] required=yes cfset arrGame = arraynew(1) !--- Return Variable --- !--- Creat Game --- cfloop index=s from=1 to=#arraylen(Games)# cfset arrGame[s] = CreateObject(component, gameTest) cfset arrGame[s].setGameID(ToString(s)) cfset arrGame[s].setHomeSSID(Games[s].getHomeSSID) /cfloop cfreturn arrGame /cffunction /cfcomponent 3) The following is the component. An array of this component is made and passed to the webservice. (gameTest.cfc) cfcomponent cfproperty name=GameID type=string cfproperty name=HomeSSID type=string !--- Initialize --- cfscript this.GameID = 0; this.HomeSSID = ; /cfscript !--- Methods --- cffunction name=getGameID access=public returntype=string cfreturn this.GameID /cffunction cffunction name=setGameID access=public cfargument name=game type=string required=yes cfset this.GameID = game /cffunction cffunction name=getHomeSSID access=public returntype=string cfreturn this.HomeSSID /cffunction cffunction name=setHomeSSID access=public cfargument name=ssid type=string required=yes cfset this.HomeSSID = ssid /cffunction /cfcomponent Basically, the testWS.cfm file creates an array of the component and passes it to the webservice. No matter what I try to do, errors continue to be thrown. I believe the problem is in the code for the webservice. Thank you for your help. ~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292178 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Structures... How Do I properly write this?
--- Bangs Head on Desk --- Duh! -Original Message- From: Robertson-Ravo, Neil (RX) [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 13, 2007 5:17 PM To: CF-Talk Subject: Re: Structures... How Do I properly write this? As a StructKeyIsEmpty wouldn't be a key :-) This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions. Visit our website at http://www.reedexpo.com -Original Message- From: Josh Nathanson To: CF-Talk Sent: Wed Jun 13 22:16:34 2007 Subject: Re: Structures... How Do I properly write this? cfif NOT structKeyIsEmpty(stWSSB_Tickler[x]) StructKeyIsEmpty is not a function, I think you want StructIsEmpty. -- Josh ~| CF 8 â Scorpio beta now available, easily build great internet experiences â Try it now 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:281119 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Structures... How Do I properly write this?
I fixed my typo but I'm still getting errors with the code below. The error I now get reads: Element 1 is undefined in a CFML structure referenced as part of an expression. I'm sure this is a simple fix... What am I missing? -Original Message- Basically, I have nested structures. I want to check if the nested structure exists first. If it does not exist, then I'll create it. Then I want to check if the nested structure's tickler value is Y. Obviously, my cfif logic is not correct. Thanks! cfif NOT isDefined(stWSSB_Tickler) cfset stWSSB_Tickler = structNew() /cfif cfloop from=1 to=#arrayLen(xmlcontent.message.items.item)# index=x cfif NOT structIsEmpty(stWSSB_Tickler[x]) cfif structFind(stWSSB_Tickler[x], tickler) NEQ Y cfset stWSSB_Tickler[x] = structNew() cfset stWSSB_Tickler[x].ord_qty = xmlcontent.message.items.item[x].ord_qty.xmlText / cfset stWSSB_Tickler[x].unit_price = xmlcontent.message.items.item[x].unit_price.xmlText / cfset stWSSB_Tickler[x].tickler = Y / /cfif /cfif /cfloop ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281128 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Structures... How Do I properly write this?
Use this cfloop from=1 to=#ArrayLen( xmlcontent.message.items.item )# index=x cfif NOT StructKeyExists( stWSSB_Tickler, x ) cfset stWSSB_Tickler[x] = StructNew() / /cfif cfif ( NOT StructKeyExists( stWSSB_Tickler[x], 'tickler' ) ) OR ( StructKeyExists( stWSSB_Tickler[x], 'tickler' ) AND stWSSB_Tickler[x].tickler neq 'Y' ) cfset stWSSB_Tickler[x].ord_qty = xmlcontent.message.items.item[x].ord_qty.xmlText / cfset stWSSB_Tickler[x].unit_price = xmlcontent.message.items.item[x].unit_price.xmlText / cfset stWSSB_Tickler[x].tickler = Y / /cfif /cfloop HTH On 6/14/07, Che Vilnonis [EMAIL PROTECTED] wrote: I fixed my typo but I'm still getting errors with the code below. The error I now get reads: Element 1 is undefined in a CFML structure referenced as part of an expression. I'm sure this is a simple fix... What am I missing? -Original Message- Basically, I have nested structures. I want to check if the nested structure exists first. If it does not exist, then I'll create it. Then I want to check if the nested structure's tickler value is Y. Obviously, my cfif logic is not correct. Thanks! cfif NOT isDefined(stWSSB_Tickler) cfset stWSSB_Tickler = structNew() /cfif cfloop from=1 to=#arrayLen(xmlcontent.message.items.item)# index=x cfif NOT structIsEmpty(stWSSB_Tickler[x]) cfif structFind(stWSSB_Tickler[x], tickler) NEQ Y cfset stWSSB_Tickler[x] = structNew() cfset stWSSB_Tickler[x].ord_qty = xmlcontent.message.items.item[x].ord_qty.xmlText / cfset stWSSB_Tickler[x].unit_price = xmlcontent.message.items.item[x].unit_price.xmlText / cfset stWSSB_Tickler[x].tickler = Y / /cfif /cfif /cfloop ~| CF 8 â Scorpio beta now available, easily build great internet experiences â Try it now 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:281148 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Structures... How Do I properly write this?
Basically, I have nested structures. I want to check if the nested structure exists first. If it does not exist, then I'll create it. Then I want to check if the nested structure's tickler value is Y. Obviously, my cfif logic is not correct. Thanks! cfif NOT isDefined(stWSSB_Tickler) cfset stWSSB_Tickler = structNew() /cfif cfloop from=1 to=#arrayLen(xmlcontent.message.items.item)# index=x cfif NOT structKeyIsEmpty(stWSSB_Tickler[x]) cfif structFind(stWSSB_Tickler[x], tickler) NEQ Y cfset stWSSB_Tickler[x] = structNew() cfset stWSSB_Tickler[x].ord_qty = xmlcontent.message.items.item[x].ord_qty.xmlText / cfset stWSSB_Tickler[x].unit_price = xmlcontent.message.items.item[x].unit_price.xmlText / cfset stWSSB_Tickler[x].tickler = Y / /cfif /cfif /cfloop Che Vilnonis Application Developer Advertising Systems Incorporated 8470C Remington Avenue Pennsauken, NJ 08110 p: 856.488.2211 f: 856.488.1990 www.asitv.com ~| ColdFusion MX7 by Adobe® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281069 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Structures... How Do I properly write this?
cfif NOT structKeyIsEmpty(stWSSB_Tickler[x]) StructKeyIsEmpty is not a function, I think you want StructIsEmpty. -- Josh ~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade see new features. http://www.adobe.com/products/coldfusion?sdid=RVJR Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281072 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Structures... How Do I properly write this?
As a StructKeyIsEmpty wouldn't be a key :-) This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions. Visit our website at http://www.reedexpo.com -Original Message- From: Josh Nathanson To: CF-Talk Sent: Wed Jun 13 22:16:34 2007 Subject: Re: Structures... How Do I properly write this? cfif NOT structKeyIsEmpty(stWSSB_Tickler[x]) StructKeyIsEmpty is not a function, I think you want StructIsEmpty. -- Josh ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281074 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
CFUNITED news: Structures and Arrays, CF is Alive!, Fusebox YouTube contest, Multi-language apps
Here is the ColdFusion and Fusebox news: * Only 27 days left until CFUNITED-07! * ColdFusion is Alive - partial survey results * CFMeetup Thur 12:30pm - Oguz Demirkapi Multi Language Applications in CF in Theory and Practice * New CFUNITED podcasts released http://cfunited.com/blog/index.cfm/podcast - Drew Robbins - An End-to-end overview of Microsoft's New Web Application Server IIS7 - Vince Bonfanti - BlueDragon - Five Years of CFUnited: Yesterday, Today and the Road Ahead. * CFUNITED-07 pre-conference classes iPod raffle - only 16 days left * Fusebox YouTube video competition ends 6/22/07 * Interview with Kurtis D Leatham on Structures, Arrays, and practical uses for both. CFUnited is the premiere ColdFusion event where all members of the CF community, regardless of experience and skill level, come together to discuss and debate the latest techniques and technologies involving web application development with ColdFusion. -Brian S.(CFUNITED attendee) Other great quotes from attendees about Why people should attend CFUnited http://cfunited.com/blog/index.cfm/2007/4/30/Survey-Contest-Winner * Only 27 days left until CFUNITED-07! Hotel info. Special event info. See the countdown flash widget on the CFUNITED site to find out exactly how many days, hours, minutes and seconds until CFUNITED! Don't miss out on the ColdFusion event of the year. If you would like to ride share your trip to CFUNITED, go to http://wiki.cfunited.com/ then login and click Share a Hotel and place a request or view a request. * ColdFusion is Alive - partial survey results Some of you may have read the Computer World article listing ColdFusion as one of 10 dead languages and Ben Forta's response, Ray's opinions and Adam's rant on this. Obviously ColdFusion is not dying but how do you convice your clients that CF is the right solution? I am giving a talk at CFUNITED-07 on Selling ColdFusion to Clients that will cover what strategies to use for selling ColdFusion to clients and how to deal with common objections that clients have. I also have partial results of the survey on your experience with what arguments have been working on the street. Read more and see the survey results at: http://teratech.com/blog/index.cfm/2007/5/30/ColdFusion-is-Alive-Partial-survey-results (If you haven't taken the survey yet then please do! There is a link from the above page to it) * CFUNITED-07 pre-conference classes iPod raffle - 16 days left Everyone who signs up before Friday 6/15/07 5pm EDT will be entered in a raffle to win one Apple iPod Nano. The iPod will be selected at random on Monday 6/18/07 from one of the people who are registered for the class. Each class registration counts as one ticket in the raffle. Registration and more info at http://cfunited.com/go/classes Monday 6/25 CU221 Rob Gonda Flex Intensive for ColdFusion Developers CU222 Ajay Sathuluri CF Server Administration for Security and More CU223 Oguz Demirkapi Multi Language Applications in CF in Theory and Practice CU224 Nate Nelson Advanced Database Tuesday 6/26 CU225 Peter Bell Practical Code Generation: By Example CU226 Simon Horwith Architecting and Optimizing CF Applications for Performance and Scalability CU227 John Paul Ashenfelter Best Practice Bootcamp for Developers CU228 Charlie Arehart New in CFMX 6 and 7: What Did You Miss? * How to get your boss to send you to CFUNITED Having trouble getting authorization to attend CFUNITED - check out these top reasons for coming! http://cfunited.com/blog/index.cfm/2007/5/15/Top-Ten-Reasons-to-Attend * User Group Manager Meeting Tues 6/26/07 - http://ugmm.cfunited.com/ * CFMeetup Thur 12:30pm - Rob Gonda Flex Intensive for ColdFusion Developers CFMeetup is a weekly half hour technical talk from CFUNITED speakers. It is hosted by Raymond Camden and Charlie Arehart of the Meetup virtual CFUG. The current schedule is every Thursday at 12:30pm - 1pm EDT. * 5/31/07 Oguz Demirkapi Multi Language Applications in CF in Theory and Practice * 6/7/07 Peter Bell Practical Code Generation: By Example * 6/14/07 Patrick Quinn UI design concepts * 6/21/07 Mark Drew CFeclipse Plus! * 6/28/07 Live from show You can get details on each talk, as well as RSVP, at: http://coldfusion.meetup.com/17/. The URL for each Acrobat Connect meeting will be http://experts.acrobat.com/cfmeetup/, where you would sign in as a guest. The talks are on Adobe Acrobat Connect so you can listen in remotely via your PC with sound via the internet. We are planning to record the talks and will provide URLs for later viewing after each event. Looking forward to seeing you there! * New CFUNITED podcasts released - Drew Robbins - An End-to-end overview of Microsoft's New Web Application Server IIS7 - Vince Bonfanti - BlueDragon - Five Years of CFUnited: Yesterday, Today and the Road Ahead. Drew Robbins - An End-to-end
Structures
Hey all, I have series of values that looks like this (sort of) A, b C, d E, f G, h Can I put this into a structure? Thanks sas -- Scott Stewart ColdFusion Developer SSTWebworks 7241 Jillspring Ct. Springfield, Va. 22152 (703) 220-2835 HYPERLINK http://www.sstwebworks.comhttp://www.sstwebworks.com -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 269.0.0/751 - Release Date: 4/7/2007 10:57 PM ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274834 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Structures
I can't see why not. On 4/9/07, Scott Stewart [EMAIL PROTECTED] wrote: Hey all, I have series of values that looks like this (sort of) A, b C, d E, f G, h Can I put this into a structure? Thanks sas -- Scott Stewart ColdFusion Developer SSTWebworks 7241 Jillspring Ct. Springfield, Va. 22152 (703) 220-2835 HYPERLINK http://www.sstwebworks.comhttp://www.sstwebworks.com -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 269.0.0/751 - Release Date: 4/7/2007 10:57 PM ~| ColdFusion MX7 by Adobe® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274835 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Structures
Sure thing (I think): cfset objValues = StructNew() / cfset objValues[ A ] = b / cfset objValues[ C ] = d / cfset objValues[ E ] = f / cfset objValues[ F ] = h / .. Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com Need ColdFusion Help? www.bennadel.com/ask-ben/ -Original Message- From: Scott Stewart [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 9:12 AM To: CF-Talk Subject: Structures Hey all, I have series of values that looks like this (sort of) A, b C, d E, f G, h Can I put this into a structure? Thanks sas ~| Create Web Applications With ColdFusion MX7 Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274836 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Structures
Possibly. Is b the value of A? If each item on the left is meant to be a key with it's intended value on the right, then by all means. Put that bad boy into a structure. -Original Message- From: Scott Stewart [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 8:12 AM To: CF-Talk Subject: Structures Hey all, I have series of values that looks like this (sort of) A, b C, d E, f G, h Can I put this into a structure? Thanks sas -- Scott Stewart ColdFusion Developer SSTWebworks 7241 Jillspring Ct. Springfield, Va. 22152 (703) 220-2835 HYPERLINK http://www.sstwebworks.comhttp://www.sstwebworks.com -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 269.0.0/751 - Release Date: 4/7/2007 10:57 PM ~| ColdFusion MX7 by Adobe® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274837 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Structures
No, A and B are separate values. sas -- Scott Stewart ColdFusion Developer SSTWebworks 7241 Jillspring Ct. Springfield, Va. 22152 (703) 220-2835 http://www.sstwebworks.com -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 9:19 AM To: CF-Talk Subject: RE: Structures Possibly. Is b the value of A? If each item on the left is meant to be a key with it's intended value on the right, then by all means. Put that bad boy into a structure. -Original Message- From: Scott Stewart [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 8:12 AM To: CF-Talk Subject: Structures Hey all, I have series of values that looks like this (sort of) A, b C, d E, f G, h Can I put this into a structure? Thanks sas -- Scott Stewart ColdFusion Developer SSTWebworks 7241 Jillspring Ct. Springfield, Va. 22152 (703) 220-2835 HYPERLINK http://www.sstwebworks.comhttp://www.sstwebworks.com -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 269.0.0/751 - Release Date: 4/7/2007 10:57 PM ~| ColdFusion MX7 by Adobe® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274838 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Structures
Okay...you could still put them into a structure if you want. What is it that you're trying to accomplish? -Original Message- From: Scott Stewart [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 8:25 AM To: CF-Talk Subject: RE: Structures No, A and B are separate values. sas -- Scott Stewart ColdFusion Developer SSTWebworks 7241 Jillspring Ct. Springfield, Va. 22152 (703) 220-2835 http://www.sstwebworks.com -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 9:19 AM To: CF-Talk Subject: RE: Structures Possibly. Is b the value of A? If each item on the left is meant to be a key with it's intended value on the right, then by all means. Put that bad boy into a structure. -Original Message- From: Scott Stewart [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 8:12 AM To: CF-Talk Subject: Structures Hey all, I have series of values that looks like this (sort of) A, b C, d E, f G, h Can I put this into a structure? Thanks sas -- Scott Stewart ColdFusion Developer SSTWebworks 7241 Jillspring Ct. Springfield, Va. 22152 (703) 220-2835 HYPERLINK http://www.sstwebworks.comhttp://www.sstwebworks.com -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 269.0.0/751 - Release Date: 4/7/2007 10:57 PM ~| Create Web Applications With ColdFusion MX7 Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274841 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Structures
You're limited to one value per key. But the value can be a struct or an array. So you could do: cfset mainStruct = StructNew() / cfset subStruct = StructNew() / cfset subStruct.One = A / cfset subStruct.Two = b / cfset mainStruct.Something = subStruct / Then you would reference the values: mainStruct.Something.One mainStruct.Something.Two __ Dave Konopka http://www.lifelikeweeds.com/tech -Original Message- From: Scott Stewart [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 9:25 AM To: CF-Talk Subject: RE: Structures No, A and B are separate values. sas -- Scott Stewart ColdFusion Developer SSTWebworks 7241 Jillspring Ct. Springfield, Va. 22152 (703) 220-2835 http://www.sstwebworks.com -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 9:19 AM To: CF-Talk Subject: RE: Structures Possibly. Is b the value of A? If each item on the left is meant to be a key with it's intended value on the right, then by all means. Put that bad boy into a structure. -Original Message- From: Scott Stewart [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 8:12 AM To: CF-Talk Subject: Structures Hey all, I have series of values that looks like this (sort of) A, b C, d E, f G, h Can I put this into a structure? Thanks sas -- Scott Stewart ColdFusion Developer SSTWebworks 7241 Jillspring Ct. Springfield, Va. 22152 (703) 220-2835 HYPERLINK http://www.sstwebworks.comhttp://www.sstwebworks.com -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 269.0.0/751 - Release Date: 4/7/2007 10:57 PM ~| ColdFusion MX7 and Flex 2 Build sales marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274842 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Structures
I'm extracting results from a table, over a range of weeks, based on the date range and a pair of values for each range. The pair values are static, but the dates aren't. I'm looping over the dates and values to dynamically build a table. Here's what I've got so far... it works but it's not elegant and it's way slow. !--- This creates the date range -- cfset dtStart = 03/12/2007 cfset dtEnd=#Now()# cfscript eSearch = 0; aSearch = 0; cfSearch = 0; sResults = 0; AI = 0; JI = 0; Th = 0; RecDisp = 0; Browse = 0; ML = 0; rSearch = 0; MPN = 0; crSearch = 0; FTC = 0; OT = 0; /cfscript table border=1 valign=top align=center BORDERCOLOR=Black tr td bgcolor=##CC class=AddRemoveRowsModule/td cfloop index=dtToday from=#dtStart# to=#dtEnd# step=#CreateTimeSpan( 7, 0, 0, 0 )# cfset hitDateStart=#DateFormat(dtToday, mmm d )# cfset hitDateEnd=#DateFormat(DateAdd(ww, 1, #hitDateStart#), mmm d )# cfset dateStruct = StructNew() cfset dateStruct.hitDateStart = #hitDateStart# cfset dateStruct.hitDateEnd = #hitDateEnd# cfoutput td bgcolor=##CC class=AddRemoveRows#hitDateStart# - #hitDateEnd#/td /cfoutput /cfloop /tr !--- end date range --- !--- this queries the table based on the passed dates and a hard coded pair of search values and builds the row --- tr td bgcolor=##CC class=AddRemoveRowsEasy Search/td cfloop index=dtToday from=#dtStart# to=#dtEnd# step=#CreateTimeSpan( 7, 0, 0, 0 )# td class=AddRemoveRows cfset hitDateStart=#DateFormat(dtToday, mmm d )# cfset hitDateEnd=#DateFormat(DateAdd(ww, 1, #hitDateStart#), mmm d )# cfset dateStruct = StructNew() cfset dateStruct.hitDateStart = #hitDateStart# cfset dateStruct.hitDateEnd = #hitDateEnd# cfset dateStruct.HitCircuit = search cfset dateStruct.HitFuseaction = easySearchForm cfset TSHitDrillObj = CreateObject(component, actions.actrptdisplay) cfinvoke component=#TSHitDrillObj# method=TimeSpanHitB returnvariable=qTimeSpanhitDetail argumentcollection=#dateStruct# cfloop query=qTimeSpanhitDetail cfset eSearch = #eSearch# + 1 /cfloop cfoutput#eSearch#/cfoutput /td /cfloop /tr I'm repeating this code block for each value pair, I want to use the block once and loop over the dates and the value pairs. Hope this makes sense -- Scott Stewart ColdFusion Developer SSTWebworks 7241 Jillspring Ct. Springfield, Va. 22152 (703) 220-2835 http://www.sstwebworks.com -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 9:39 AM To: CF-Talk Subject: RE: Structures Okay...you could still put them into a structure if you want. What is it that you're trying to accomplish? -Original Message- From: Scott Stewart [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 8:25 AM To: CF-Talk Subject: RE: Structures No, A and B are separate values. sas -- Scott Stewart ColdFusion Developer SSTWebworks 7241 Jillspring Ct. Springfield, Va. 22152 (703) 220-2835 http://www.sstwebworks.com -Original Message- From: Andy Matthews [mailto:[EMAIL
Re: Structures
Using ceateobject inside each iteration of the loop to create exactly the same object each time is going to be part of that slowness... On 4/9/07, Scott Stewart [EMAIL PROTECTED] wrote: Here's what I've got so far... it works but it's not elegant and it's way slow. -- mxAjax / CFAjax docs and other useful articles: http://www.bifrost.com.au/blog/ ~| Create Web Applications With ColdFusion MX7 Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274846 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Structures
Thanks... sas -- Scott Stewart ColdFusion Developer SSTWebworks 7241 Jillspring Ct. Springfield, Va. 22152 (703) 220-2835 http://www.sstwebworks.com -Original Message- From: James Holmes [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 9:58 AM To: CF-Talk Subject: Re: Structures Using ceateobject inside each iteration of the loop to create exactly the same object each time is going to be part of that slowness... On 4/9/07, Scott Stewart [EMAIL PROTECTED] wrote: Here's what I've got so far... it works but it's not elegant and it's way slow. -- mxAjax / CFAjax docs and other useful articles: http://www.bifrost.com.au/blog/ ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274847 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Structures in Java?
The container takes care of the majority of threading issues for you; only when multiple requests access the same data (i.e. session or application scope) does threading matter to the application developer. If you have request-level data, concurrency isn't be a concern unless you're explicitly multithreading your request. Note that instance variables of shared-scope CFC's count as cross-request data, but local variables inside CFC methods (including arguments) do not. cheers, barneyb On 10/1/06, Mark Mandel [EMAIL PROTECTED] wrote: Your probably better off with a java.util.Hashtable, as it is already syncronised (thread safe), and more often than not, where are using Hashtables in a web environment, they need to be thread safe. That being said, java.util.Collections gives you some easy to use utilities to create synchronised Maps very easily. HTH Mark -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 100 invites. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255015 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Structures in Java?
Thanks Guys, that is some excellent info to keep in mind. (and that I sometimes forget to think about (e.g. worked fine in dev mode, how come it's all squirrly now?!?! ;)). Yet I went with the thread safe ajax stuff at first... just cuz... how haphazard of me. =P I vow to become a more aware coder. Vow it I say! :Denny On 10/2/06, Barney Boisvert [EMAIL PROTECTED] wrote: The container takes care of the majority of threading issues for you; only when multiple requests access the same data (i.e. session or application scope) does threading matter to the application developer. If you have request-level data, concurrency isn't be a concern unless you're explicitly multithreading your request. Note that instance variables of shared-scope CFC's count as cross-request data, but local variables inside CFC methods (including arguments) do not. cheers, barneyb On 10/1/06, Mark Mandel [EMAIL PROTECTED] wrote: Your probably better off with a java.util.Hashtable, as it is already syncronised (thread safe), and more often than not, where are using Hashtables in a web environment, they need to be thread safe. That being said, java.util.Collections gives you some easy to use utilities to create synchronised Maps very easily. HTH Mark ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255097 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Structures in Java?
Is there anything in Java similar to Coldfusions Structures? ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254928 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Structures in Java?
On 10/1/06, D F [EMAIL PROTECTED] wrote: Is there anything in Java similar to Coldfusions Structures? Remember that ColdFusion is compiled to Java, so there's always going to be a related data type between the two languages. In this case, you want a HashMap, which is what a CF structure is under the hood: http://java.sun.com/j2se/1.4.2/docs/api/java/util/HashMap.html Regards, Dave. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254929 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Structures in Java?
Thanks Dave, so presumably this HashMap object can be passed around through various methods etc? On 10/1/06, D F [EMAIL PROTECTED] wrote: Is there anything in Java similar to Coldfusions Structures? Remember that ColdFusion is compiled to Java, so there's always going to be a related data type between the two languages. In this case, you want a HashMap, which is what a CF structure is under the hood: http://java.sun.com/j2se/1.4.2/docs/api/java/util/HashMap.html Regards, Dave. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254930 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Structures in Java?
On 10/1/06, D F [EMAIL PROTECTED] wrote: Thanks Dave, so presumably this HashMap object can be passed around through various methods etc? If I'm understanding what you're trying to to do, then yes, you can pass Java objects just like you can pass CF objects around. The big difference is that, if you pass it as an argument to a cffunction call, then the cfargument tag should expect a type of any to use the Java object correctly. Regards, Dave. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254931 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Structures in Java?
On 10/1/06, D F [EMAIL PROTECTED] wrote: Thanks Dave, so presumably this HashMap object can be passed around through various methods etc? Pretty much. I think the one thing you need to keep in your head is that in java, everything starts at 0, and CF starts with 1. There is a word that I should replace everything with.. maybe indices? Eh. ** On a side note, I can't decide whether I'm dealing with a open loop, or a black hole, on another issue... anyone know how to tell the difference? Is it just taking a long time to get back to me? /me blows the dust off of some Hawking books Stupid jokes award!?! Sign me up! -Den ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254933 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Structures in Java?
Your probably better off with a java.util.Hashtable, as it is already syncronised (thread safe), and more often than not, where are using Hashtables in a web environment, they need to be thread safe. That being said, java.util.Collections gives you some easy to use utilities to create synchronised Maps very easily. HTH Mark On 10/2/06, Dave Carabetta [EMAIL PROTECTED] wrote: On 10/1/06, D F [EMAIL PROTECTED] wrote: Thanks Dave, so presumably this HashMap object can be passed around through various methods etc? If I'm understanding what you're trying to to do, then yes, you can pass Java objects just like you can pass CF objects around. The big difference is that, if you pass it as an argument to a cffunction call, then the cfargument tag should expect a type of any to use the Java object correctly. Regards, Dave. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254942 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Persistance of ColdFusion Structures
All: Are ColdFusion structures meant to be persistent across pages. I have an app where I need to trap form field data, if a user has entered an ID that already exists, and give them the option of reviewing the existing and then submitting without re-entering. Scott Stewart ColdFusion Developer/Administrator GlobalNet Services, Inc. www.gnsi.com BLOCKED::http://www.gnsi.com/ 301-770-9610 x358 (Voice) 301-770-9611 (Fax) The information contained in this message may be privileged, confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or any employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244380 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: Persistance of ColdFusion Structures
a structure in and of itself is just...a variable. Whether or not it persists depends on the scope in which the variable (structure) exists. the form scope (which is a structure) exists on the form's action page, and will not persist beyond that. You could put it into the session scope: cfset session.userFormData = duplicate(form) / Make sure you use duplicate, since structCopy will create a pointer to the form scope/struct, which will cease to exist past the action page. duplicate() creates a deep copy and the new variable will exist on its own, independent of the original structure from which it was copied. On 6/21/06, Scott Stewart [EMAIL PROTECTED] wrote: All: Are ColdFusion structures meant to be persistent across pages. I have an app where I need to trap form field data, if a user has entered an ID that already exists, and give them the option of reviewing the existing and then submitting without re-entering. Scott Stewart ColdFusion Developer/Administrator GlobalNet Services, Inc. www.gnsi.com BLOCKED::http://www.gnsi.com/ 301-770-9610 x358 (Voice) 301-770-9611 (Fax) The information contained in this message may be privileged, confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or any employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244382 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