Re: Smallest, coolest function I ever wrote: Struct()

2006-01-05 Thread Sam Farmer
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:

Re: Smallest, coolest function I ever wrote: Struct()

2006-01-05 Thread Ali Awan
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

Re: Smallest, coolest function I ever wrote: Struct()

2006-01-05 Thread Ali Awan
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:

RE: Smallest, coolest function I ever wrote: Struct()

2006-01-05 Thread Munson, Jacob
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

Re: Smallest, coolest function I ever wrote: Struct()

2006-01-04 Thread James Holmes
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

Smallest, coolest function I ever wrote: Struct()

2006-01-04 Thread Brendan Baldwin
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:

RE: Smallest, coolest function I ever wrote: Struct()

2006-01-04 Thread Damien McKenna
-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

Re: Smallest, coolest function I ever wrote: Struct()

2006-01-04 Thread Ryan Guill
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

Re: Smallest, coolest function I ever wrote: Struct()

2006-01-04 Thread Barney Boisvert
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-

Re: Smallest, coolest function I ever wrote: Struct()

2006-01-04 Thread Brendan Baldwin
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

RE: Smallest, coolest function I ever wrote: Struct()

2006-01-04 Thread Munson, Jacob
:[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

Re: Smallest, coolest function I ever wrote: Struct()

2006-01-04 Thread Bryan Stevenson
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

Re: Smallest, coolest function I ever wrote: Struct()

2006-01-04 Thread Raymond Camden
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! --

Re: Smallest, coolest function I ever wrote: Struct()

2006-01-04 Thread andy
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:

Re: Smallest, coolest function I ever wrote: Struct()

2006-01-04 Thread Brendan Baldwin
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

RE: Smallest, coolest function I ever wrote: Struct()

2006-01-04 Thread Baz
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

RE: Smallest, coolest function I ever wrote: Struct()

2006-01-04 Thread Dave Watts
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.

Re: Smallest, coolest function I ever wrote: Struct()

2006-01-04 Thread Brendan Baldwin
-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