Re: Smallest, coolest function I ever wrote: Struct()
You could use the built in listToArray myarray = listToArray('homer,marge,bart'); Cheers, Sam F On 1/4/06, Ryan Guill [EMAIL PROTECTED] wrote: How about one for an array? This is pretty cool. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228441 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Smallest, coolest function I ever wrote: Struct()
I've been using cf since version 3, and I always remember it being there. I've always used, helped me immensely. It reminds me of ValueList(). I'm not sure how long that's been available in CF (seems like it's new to CF6 or CF7), but I've heard people say That was something I always had to code every time, I didn't know that function existed! I'm pretty sure it's been there since CF 2 if not earlier. 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! ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228470 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Smallest, coolest function I ever wrote: Struct()
it = valuelist() I've been using cf since version 3, and I always remember it being there. I've always used, helped me immensely. Visit http://training.figleaf.com/ for more information! ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228499 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Smallest, coolest function I ever wrote: Struct()
It is very handy. It's one of those 'well duh!' functions that CF has, that a lot of people don't know about. I've been using CF since v. 4, and I just found out about it a few months ago. :) But I've never read any CF books or had any training (aside from conferences), so that might explain my ignorance of ValueList(). -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 04, 2006 8:09 PM It reminds me of ValueList(). I'm not sure how long that's been available in CF (seems like it's new to CF6 or CF7), but I've heard people say That was something I always had to code every time, I didn't know that function existed! I'm pretty sure it's been there since CF 2 if not earlier. --- This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. A1. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228524 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Smallest, coolest function I ever wrote: Struct()
I got curious and tried the same thing in tag syntax and it works too: cffunction name=Struct returntype=struct cfreturn arguments /cffunction Just when I though there was a use for cfscript after all... :-) On 1/5/06, Brendan Baldwin [EMAIL PROTECTED] wrote: Here's the actual function in cfscript: function Struct() { return arguments; } -- CFAJAX docs and other useful articles: http://jr-holmes.coldfusionjournal.com/ ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228426 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Smallest, coolest function I ever wrote: Struct()
-Original Message- From: Brendan Baldwin [mailto:[EMAIL PROTECTED] function Struct() { return arguments; } That's brilliant! :-D You need to get that in cflib! -- Damien McKenna - Web Developer - [EMAIL PROTECTED] The Limu Company - http://www.thelimucompany.com/ - 407-804-1014 #include stdjoke.h ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228381 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Smallest, coolest function I ever wrote: Struct()
How about one for an array? This is pretty cool. On 1/4/06, Damien McKenna [EMAIL PROTECTED] wrote: -Original Message- From: Brendan Baldwin [mailto:[EMAIL PROTECTED] function Struct() { return arguments; } That's brilliant! :-D You need to get that in cflib! -- Damien McKenna - Web Developer - [EMAIL PROTECTED] The Limu Company - http://www.thelimucompany.com/ - 407-804-1014 #include stdjoke.h ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228383 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Smallest, coolest function I ever wrote: Struct()
newStruct, I believe, is already in cflib to do the same thing. newArray as well, I believe. Now if only these were built-ins, so we could actually a struct and array literals in CFML, but oh well. cheers, barneyb On 1/4/06, Damien McKenna [EMAIL PROTECTED] wrote: -Original Message- From: Brendan Baldwin [mailto:[EMAIL PROTECTED] function Struct() { return arguments; } That's brilliant! :-D You need to get that in cflib! -- Damien McKenna - Web Developer - [EMAIL PROTECTED] The Limu Company - http://www.thelimucompany.com/ - 407-804-1014 #include stdjoke.h ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228386 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Smallest, coolest function I ever wrote: Struct()
I think it should be a language feature. Same thing happened with everybody writing a custom tag to do the same thing they finally did with CFSAVECONTENT. Just feels too basic to not be included in the core language somehow. But it was fun to have the lightbulb go off in my head. I'd been doing an iterative solution like that UDF in cflib for a couple months and then it just kind of hit me how unnecessary that was! Funny what a morning cup of coffee will do. --Brendan http://www.brendanbaldwin.com On 1/4/06, Damien McKenna [EMAIL PROTECTED] wrote: -Original Message- From: Brendan Baldwin [mailto:[EMAIL PROTECTED] function Struct() { return arguments; } That's brilliant! :-D You need to get that in cflib! -- Damien McKenna - Web Developer - [EMAIL PROTECTED] The Limu Company - http://www.thelimucompany.com/ - 407-804-1014 #include stdjoke.h ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228387 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: Smallest, coolest function I ever wrote: Struct()
It reminds me of ValueList(). I'm not sure how long that's been available in CF (seems like it's new to CF6 or CF7), but I've heard people say That was something I always had to code every time, I didn't know that function existed! -Original Message- From: Brendan Baldwin [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 04, 2006 2:38 PM To: CF-Talk Subject: Re: Smallest, coolest function I ever wrote: Struct() I think it should be a language feature. Same thing happened with everybody writing a custom tag to do the same thing they finally did with CFSAVECONTENT. Just feels too basic to not be included in the core language somehow. This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. A1. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228388 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Smallest, coolest function I ever wrote: Struct()
It reminds me of ValueList(). I'm not sure how long that's been available in CF (seems like it's new to CF6 or CF7), but I've heard people say That was something I always had to code every time, I didn't know that function existed! Not 100% surebut I think it's been around since 3.1 or 4 (certainly not new in MX) ;-) Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL PROTECTED] web: www.electricedgesystems.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228391 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: Smallest, coolest function I ever wrote: Struct()
CFLib had one - but I have updated it with this version. -ray On 1/4/06, Damien McKenna [EMAIL PROTECTED] wrote: -Original Message- From: Brendan Baldwin [mailto:[EMAIL PROTECTED] function Struct() { return arguments; } That's brilliant! :-D You need to get that in cflib! -- ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228392 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Smallest, coolest function I ever wrote: Struct()
That's a nice function Brendan. Good job. andy Here's the actual function in cfscript: function Struct() { return arguments; } I posted about its use here: http://www.brendanbaldwin.com/post/structfunction/ Basically though, it lets you do this: customer=Struct(id=1,name=Brendan,occupation=Web-Lackey); Which does the equivalent of: customer=StructNew(); StructInsert(customer,id,1); StructInsert(customer,name,Brendan); StructInsert(customer,occupation,Web-Lackey); Pass it on! :-) --Brendan Baldwin http://www.brendanbaldwin.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228394 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Smallest, coolest function I ever wrote: Struct()
You know, what I'd REALLY like is for CFScript to adopt the JavaScript convention of allowing the creation of Structs like: person = {id=1,name=Brendan,occupation=Thumb-Twiddler}; Of course, they could throw in an Array constructor too: people = [Brendan,Ray,Andy]; I can dream... or switch to Ruby ;-) ? Come on Macromedia!!! Make my dreams come true!!! --Brendan http://www.brendanbaldwin.com On 1/4/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: That's a nice function Brendan. Good job. andy Here's the actual function in cfscript: function Struct() { return arguments; } I posted about its use here: http://www.brendanbaldwin.com/post/structfunction/ Basically though, it lets you do this: customer=Struct(id=1,name=Brendan,occupation=Web-Lackey); Which does the equivalent of: customer=StructNew(); StructInsert(customer,id,1); StructInsert(customer,name,Brendan); StructInsert(customer,occupation,Web-Lackey); Pass it on! :-) --Brendan Baldwin http://www.brendanbaldwin.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228396 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Smallest, coolest function I ever wrote: Struct()
Another nice one is: QuerySetRow(Query=Users,Name='Foo',Password='Bar',Date=now(),RowNumber=2); To replace: querySetCell(Users,'Name','Foo',2); querySetCell(Users,'Password','Bar',2); querySetCell(Users,'Date',now(),2); Baz -Original Message- From: Brendan Baldwin [mailto:[EMAIL PROTECTED] Sent: January 4, 2006 6:12 PM To: CF-Talk Subject: Re: Smallest, coolest function I ever wrote: Struct() You know, what I'd REALLY like is for CFScript to adopt the JavaScript convention of allowing the creation of Structs like: person = {id=1,name=Brendan,occupation=Thumb-Twiddler}; Of course, they could throw in an Array constructor too: people = [Brendan,Ray,Andy]; I can dream... or switch to Ruby ;-) ? Come on Macromedia!!! Make my dreams come true!!! --Brendan http://www.brendanbaldwin.com On 1/4/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: That's a nice function Brendan. Good job. andy Here's the actual function in cfscript: function Struct() { return arguments; } I posted about its use here: http://www.brendanbaldwin.com/post/structfunction/ Basically though, it lets you do this: customer=Struct(id=1,name=Brendan,occupation=Web-Lackey); Which does the equivalent of: customer=StructNew(); StructInsert(customer,id,1); StructInsert(customer,name,Brendan); StructInsert(customer,occupation,Web-Lackey); Pass it on! :-) --Brendan Baldwin http://www.brendanbaldwin.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228414 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Smallest, coolest function I ever wrote: Struct()
It reminds me of ValueList(). I'm not sure how long that's been available in CF (seems like it's new to CF6 or CF7), but I've heard people say That was something I always had to code every time, I didn't know that function existed! I'm pretty sure it's been there since CF 2 if not earlier. 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! ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228417 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: Smallest, coolest function I ever wrote: Struct()
Nice! On 1/4/06, Baz [EMAIL PROTECTED] wrote: Another nice one is: QuerySetRow(Query=Users,Name='Foo',Password='Bar',Date=now(),RowNumber=2); To replace: querySetCell(Users,'Name','Foo',2); querySetCell(Users,'Password','Bar',2); querySetCell(Users,'Date',now(),2); Baz -Original Message- From: Brendan Baldwin [mailto:[EMAIL PROTECTED] Sent: January 4, 2006 6:12 PM To: CF-Talk Subject: Re: Smallest, coolest function I ever wrote: Struct() You know, what I'd REALLY like is for CFScript to adopt the JavaScript convention of allowing the creation of Structs like: person = {id=1,name=Brendan,occupation=Thumb-Twiddler}; Of course, they could throw in an Array constructor too: people = [Brendan,Ray,Andy]; I can dream... or switch to Ruby ;-) ? Come on Macromedia!!! Make my dreams come true!!! --Brendan http://www.brendanbaldwin.com On 1/4/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: That's a nice function Brendan. Good job. andy Here's the actual function in cfscript: function Struct() { return arguments; } I posted about its use here: http://www.brendanbaldwin.com/post/structfunction/ Basically though, it lets you do this: customer=Struct(id=1,name=Brendan,occupation=Web-Lackey); Which does the equivalent of: customer=StructNew(); StructInsert(customer,id,1); StructInsert(customer,name,Brendan); StructInsert(customer,occupation,Web-Lackey); Pass it on! :-) --Brendan Baldwin http://www.brendanbaldwin.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228425 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