<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-1973750947775262558.post8332089753701976432..comments</id><updated>2010-01-29T15:52:23.427-05:00</updated><title type='text'>Comments on MXUnit Blog: Looping over an array in CFScript</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.mxunit.org/feeds/8332089753701976432/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1973750947775262558/8332089753701976432/comments/default'/><link rel='alternate' type='text/html' href='http://blog.mxunit.org/2009/10/looping-over-array-in-cfscript.html'/><author><name>bill shelton</name><uri>http://www.blogger.com/profile/06624894387927690246</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1973750947775262558.post-2915464975965048508</id><published>2010-01-29T15:52:23.427-05:00</published><updated>2010-01-29T15:52:23.427-05:00</updated><title type='text'>just a thought : you don't have to convert the lis...</title><content type='html'>just a thought : you don&amp;#39;t have to convert the list into an array. you can also use:&lt;br /&gt;&lt;br /&gt; list = &amp;quot;ten,eleven,twelve&amp;quot;;&lt;br /&gt; for (j=1; j lte ListLen(list); j++) {&lt;br /&gt;  writeOutput(&amp;#39;...&amp;#39;);&lt;br /&gt;  writeOutput(listGetAt(list,j) &amp;amp;  &amp;#39;&lt;br&gt;&amp;#39;);&lt;br /&gt; }</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1973750947775262558/8332089753701976432/comments/default/2915464975965048508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1973750947775262558/8332089753701976432/comments/default/2915464975965048508'/><link rel='alternate' type='text/html' href='http://blog.mxunit.org/2009/10/looping-over-array-in-cfscript.html?showComment=1264798343427#c2915464975965048508' title=''/><author><name>FuzzySiberians</name><uri>http://www.blogger.com/profile/09485259184078816185</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.mxunit.org/2009/10/looping-over-array-in-cfscript.html' ref='tag:blogger.com,1999:blog-1973750947775262558.post-8332089753701976432' source='http://www.blogger.com/feeds/1973750947775262558/posts/default/8332089753701976432' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1973750947775262558.post-3346247850234881523</id><published>2009-10-30T11:39:06.968-04:00</published><updated>2009-10-30T11:39:06.968-04:00</updated><title type='text'>@Marc

Once again, another great tip to file away....</title><content type='html'>@Marc&lt;br /&gt;&lt;br /&gt;Once again, another great tip to file away. very cool!&lt;br /&gt;&lt;br /&gt;-Mick</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1973750947775262558/8332089753701976432/comments/default/3346247850234881523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1973750947775262558/8332089753701976432/comments/default/3346247850234881523'/><link rel='alternate' type='text/html' href='http://blog.mxunit.org/2009/10/looping-over-array-in-cfscript.html?showComment=1256917146968#c3346247850234881523' title=''/><author><name>Micky Dionisio</name><uri>http://www.blogger.com/profile/12849444647466518787</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.mxunit.org/2009/10/looping-over-array-in-cfscript.html' ref='tag:blogger.com,1999:blog-1973750947775262558.post-8332089753701976432' source='http://www.blogger.com/feeds/1973750947775262558/posts/default/8332089753701976432' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1973750947775262558.post-4355232991774404903</id><published>2009-10-30T09:06:12.778-04:00</published><updated>2009-10-30T09:06:12.778-04:00</updated><title type='text'>great information guys. Thanks.

Micky, your frien...</title><content type='html'>great information guys. Thanks.&lt;br /&gt;&lt;br /&gt;Micky, your friend needn&amp;#39;t decompile if he simply wants  to see the inheritance tree, available methods, etc. I whipped this up really quick to give a quick and dirty view of a CF Array, but you could use this for just about any cf datatype. note this is literally about 15 minutes of work, just to give me a fast idea of what&amp;#39;s what:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;cfscript&amp;gt;&lt;br /&gt; a = [&amp;quot;one&amp;quot;,&amp;quot;two&amp;quot;];&lt;br /&gt; writedump(var=getMetadata(a),expand=false);&lt;br /&gt; s = {key1=&amp;quot;hi mom&amp;quot;,key2=a};&lt;br /&gt; writedump(var=getMetadata(s),expand=false);&lt;br /&gt; writedump(createDirtyStructView(a));&lt;br /&gt; writedump(createDirtyStructView(s));&lt;br /&gt;&lt;br /&gt; public struct function createDirtyStructView(someVar){&lt;br /&gt;  var cls = someVar.getClass();&lt;br /&gt;  var data = {className=cls.getName(),exceptions=[],methods=[],interfaces=[],parent=cls.getSuperClass().getName(),tree=[]};&lt;br /&gt;  var classes = cls.getClasses();&lt;br /&gt;  var methods = cls.getMethods();&lt;br /&gt;  var interfaces = cls.getSuperClass().getInterfaces();&lt;br /&gt;  var i = 1;&lt;br /&gt;  //writeDump(methods);&lt;br /&gt;  for(i=1;i&amp;lt;=ArrayLen(classes);i++){&lt;br /&gt;   arrayAppend(data.exceptions,classes[i].getName());&lt;br /&gt;  }&lt;br /&gt;  for(i=1;i&amp;lt;=ArrayLen(methods);i++){&lt;br /&gt;   arrayAppend(data.methods,methods[i].getName());&lt;br /&gt;  }&lt;br /&gt;  for(i=1;i&amp;lt;=ArrayLen(interfaces);i++){&lt;br /&gt;   arrayAppend(data.interfaces,interfaces[i].getName());&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  var thisParentClass = cls;&lt;br /&gt;  var thisParentName = thisParentClass.getName();&lt;br /&gt;  arrayPrepend(data.tree,thisParentName);&lt;br /&gt;  var sentry = 100;&lt;br /&gt;  while(thisParentName != &amp;quot;java.lang.Object&amp;quot; &amp;amp;&amp;amp; i &amp;lt; sentry){&lt;br /&gt;   thisParentClass = thisParentClass.getSuperClass();&lt;br /&gt;   thisParentName = thisParentClass.getName();&lt;br /&gt;   arrayPrepend(data.tree,thisParentName);&lt;br /&gt;   i++;&lt;br /&gt;  }&lt;br /&gt;  return data;&lt;br /&gt; }&lt;br /&gt;&amp;lt;/cfscript&amp;gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1973750947775262558/8332089753701976432/comments/default/4355232991774404903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1973750947775262558/8332089753701976432/comments/default/4355232991774404903'/><link rel='alternate' type='text/html' href='http://blog.mxunit.org/2009/10/looping-over-array-in-cfscript.html?showComment=1256907972778#c4355232991774404903' title=''/><author><name>Marc Esher</name><uri>http://www.blogger.com/profile/05942611191966201181</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08495646389580511931'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.mxunit.org/2009/10/looping-over-array-in-cfscript.html' ref='tag:blogger.com,1999:blog-1973750947775262558.post-8332089753701976432' source='http://www.blogger.com/feeds/1973750947775262558/posts/default/8332089753701976432' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1973750947775262558.post-6212752010241130712</id><published>2009-10-30T03:30:43.838-04:00</published><updated>2009-10-30T03:30:43.838-04:00</updated><title type='text'>last post on this promise.

using a java arraylist...</title><content type='html'>last post on this promise.&lt;br /&gt;&lt;br /&gt;using a java arraylist with iterator is 500x faster than cf&amp;#39;s for loop and cf for loop using iterator.&lt;br /&gt;&lt;br /&gt;createobject(&amp;quot;java&amp;quot;, &amp;quot;java.util.ArrayList&amp;quot;);&lt;br /&gt;&lt;br /&gt;-Mick</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1973750947775262558/8332089753701976432/comments/default/6212752010241130712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1973750947775262558/8332089753701976432/comments/default/6212752010241130712'/><link rel='alternate' type='text/html' href='http://blog.mxunit.org/2009/10/looping-over-array-in-cfscript.html?showComment=1256887843838#c6212752010241130712' title=''/><author><name>Micky Dionisio</name><uri>http://www.blogger.com/profile/12849444647466518787</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.mxunit.org/2009/10/looping-over-array-in-cfscript.html' ref='tag:blogger.com,1999:blog-1973750947775262558.post-8332089753701976432' source='http://www.blogger.com/feeds/1973750947775262558/posts/default/8332089753701976432' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1973750947775262558.post-4271793394255210872</id><published>2009-10-30T02:59:02.034-04:00</published><updated>2009-10-30T02:59:02.034-04:00</updated><title type='text'>Mark Mandel pointed out that this may be slower si...</title><content type='html'>Mark Mandel pointed out that this may be slower since it uses reflection via JavaProxy. Something to consider!&lt;br /&gt;&lt;br /&gt;-Mick</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1973750947775262558/8332089753701976432/comments/default/4271793394255210872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1973750947775262558/8332089753701976432/comments/default/4271793394255210872'/><link rel='alternate' type='text/html' href='http://blog.mxunit.org/2009/10/looping-over-array-in-cfscript.html?showComment=1256885942034#c4271793394255210872' title=''/><author><name>Micky Dionisio</name><uri>http://www.blogger.com/profile/12849444647466518787</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.mxunit.org/2009/10/looping-over-array-in-cfscript.html' ref='tag:blogger.com,1999:blog-1973750947775262558.post-8332089753701976432' source='http://www.blogger.com/feeds/1973750947775262558/posts/default/8332089753701976432' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1973750947775262558.post-6671951700127749879</id><published>2009-10-29T22:48:41.678-04:00</published><updated>2009-10-29T22:48:41.678-04:00</updated><title type='text'>good tip,marc! challenged me to see if i could mak...</title><content type='html'>good tip,marc! challenged me to see if i could make it smaller ... i wonder just how small a cf loop could be? &lt;br /&gt;&lt;br /&gt;for(i=-1;++ilt;myarray.size();) {&lt;br /&gt;  ...myarray.get(i);&lt;br /&gt;}</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1973750947775262558/8332089753701976432/comments/default/6671951700127749879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1973750947775262558/8332089753701976432/comments/default/6671951700127749879'/><link rel='alternate' type='text/html' href='http://blog.mxunit.org/2009/10/looping-over-array-in-cfscript.html?showComment=1256870921678#c6671951700127749879' title=''/><author><name>bill shelton</name><uri>http://www.blogger.com/profile/06624894387927690246</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='17359140296736057249'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.mxunit.org/2009/10/looping-over-array-in-cfscript.html' ref='tag:blogger.com,1999:blog-1973750947775262558.post-8332089753701976432' source='http://www.blogger.com/feeds/1973750947775262558/posts/default/8332089753701976432' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1973750947775262558.post-4060378739742025449</id><published>2009-10-29T21:11:53.443-04:00</published><updated>2009-10-29T21:11:53.443-04:00</updated><title type='text'>I wish CF9 add the for..in loop support for array....</title><content type='html'>I wish CF9 add the for..in loop support for array.  Looping an array is easier using &amp;lt;cfloop array=&amp;quot;&amp;quot;&amp;gt; than cfscript.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1973750947775262558/8332089753701976432/comments/default/4060378739742025449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1973750947775262558/8332089753701976432/comments/default/4060378739742025449'/><link rel='alternate' type='text/html' href='http://blog.mxunit.org/2009/10/looping-over-array-in-cfscript.html?showComment=1256865113443#c4060378739742025449' title=''/><author><name>Henry Ho</name><uri>http://www.blogger.com/profile/17002578166283757395</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.mxunit.org/2009/10/looping-over-array-in-cfscript.html' ref='tag:blogger.com,1999:blog-1973750947775262558.post-8332089753701976432' source='http://www.blogger.com/feeds/1973750947775262558/posts/default/8332089753701976432' type='text/html'/></entry></feed>