Skip to main content

jdyer

Member since Jun 8, 2011

Recent Blog Comments By jdyer

  • Ask Ben: Simple Recursion Example

    Posted on Apr 9, 2012 at 3:38 PM

    @Josh, @Ben, Sorry, but I made two quickie errors in my example code. The cfset for the current URL should read: <cfset LOCAL.currentURL = "#Arguments.ParentURL#/#LCase(ReReplace(LOCAL.Children.name,' ','_','all'))#">... read more »

  • Ask Ben: Simple Recursion Example

    Posted on Apr 9, 2012 at 3:33 PM

    @Josh Also, note that you can do any name conversions for the url, not just space to underscore. You could also check for private urls. Say mango is only allowed to be seen if you are a certain user. Then you could add the following psuedo code: Coldfusion 9 or above (insert right after... read more »

  • Ask Ben: Simple Recursion Example

    Posted on Apr 9, 2012 at 3:15 PM

    @Ben, @Josh, Considering you said you were using the recursive code above, and assuming your children names are the names shown, such as "Apple", or "Granny Smith", (and I also assume the typo in the example for Granny Smith as it should have an ending slash as well) t... read more »

  • Ask Ben: Simple Recursion Example

    Posted on Aug 26, 2011 at 5:52 PM

    @dimrie, I made one minor mistake in my post. Since I changed the function name, the name in the recursive call should have been changed as well. <cfset OutputMenu(Data = ARGUMENTS.Data, ParentID = LOCAL.Children.id, RecursionLevel=RecursionLevel+1) /> Not: <cfset OutputChild... read more »

  • Ask Ben: Simple Recursion Example

    Posted on Aug 26, 2011 at 5:49 PM

    @dimrie, The easiest way would be to pass in the level, or use a global counter. Method one--Passing it in. <cffunction name="OutputMenu" access="public" returntype="void" output="true" hint="Outputs the child menu of a given parent.">  ... read more »

  • LOCAL Variables Scope Conflicts With ColdFusion Query of Queries

    Posted on Jun 23, 2011 at 5:52 PM

    If you are trying to debug some code and are not throwing your own error, then wrap this around code you suspect of creating the error. try { //your code } catch(Any excpt) { if (Is(Defined(Request.poppedFLSCount)) { while (Request.poppedFLSCount GT 0) { getPageContext().pushNewFuncti... read more »

  • LOCAL Variables Scope Conflicts With ColdFusion Query of Queries

    Posted on Jun 23, 2011 at 5:30 PM

    Here is the throw function so you can see how to correct the problem. <cffunction name="throw" output="false" returnType="void" hint="CFML Throw wrapper"> <cfargument name="file" type="string" required="false" default... read more »

  • LOCAL Variables Scope Conflicts With ColdFusion Query of Queries

    Posted on Jun 23, 2011 at 5:27 PM

    Here is an update of the function with a counting semaphore in the Request scope and an error thrown if somevar is not a string. //Allows creation of a local variable anywhere in a function. function var(somevar) { var oldlocal=""; getPageContext().popFunctionLocalScope();//Get rid ... read more »

  • LOCAL Variables Scope Conflicts With ColdFusion Query of Queries

    Posted on Jun 23, 2011 at 5:26 PM

    One thing I've noticed when playing around with active function local scopes and popping them is that it can mess with the stack trace. If an error occurs or if you purposely throw an error and you have popped function local scopes (in other words, it happens before you have restored the fun... read more »

  • Ask Ben: Simple Recursion Example

    Posted on Jun 13, 2011 at 12:16 AM

    I ran into another issue playing with your recursive function. I decided to rewrite it with modifying as little as possible to make it non-recursive. This meant that instead of converting it to cfscript, I kept it tag based. When doing this, I could not figure out why the index would not accept t... read more »

  • Ask Ben: Simple Recursion Example

    Posted on Jun 12, 2011 at 9:52 PM

    I posted a comment related to the topic and asking a question of my own, but it was deleted, probably for the long code block, but I really would like to know the answer. It is possible to rewrite an infinite recursive function as a single for loop. You only have to create an array to store... read more »

  • LOCAL Variables Scope Conflicts With ColdFusion Query of Queries

    Posted on Jun 12, 2011 at 9:19 PM

    I was wondering why my comment was deleted? I posted a very elegant solution to the problem allowing local variables to be declared anywhere in a CF8 function using syntax similar to the var declaration. Was it because I expounded on it's usefulness, giving multiple examples? I think thi... read more »

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel