ok, last addition, then I must go... ```<cfscr...
# cfml-general
g
ok, last addition, then I must go...
Copy code
<cfscript>
    // This is the same
    function test1(){
     return "foo";
    }
    
    test2 = test1 {

	};
	
	writeOutput(test2);
	
	// As this
	function test3(){
     return "foo";
    }
    
    test2 = test3;
    
    writeOutput(test2);
    
    // But this fails ( uncomment )
    /*
    function test4(){
     return "foo";
    }
    
    writeOutput(test4 {

	});
	*/
	
</cfscript>
n
pls use threads.
💯 5
☝🏻 3
🎯 4
☝️ 2
g
sure
anyway, this is syntax I don't plan to use , and hopefully no one else is using...
or maybe is using in a consistent manner in Lucee ? with no plans to support ACF ?
Sorry about the long rant in the channel, I look forward to your comments
p
Use cfdocs.org gives full explanation of syntaxes to use
➕ 2
r
I find that it's generally best to avoid the tag as script crap replacements unless it's the only option. For example, I would recommend using
directoryList()
instead of
<cfdirectory action="list">
.
t
But as brad is saying in a thread higher up, both CF engines have "generic script syntax." Lucee's drops the "cf":
http method="get" ...
Adobe's doesn't:
cfhttp(method="get", ...)
I use the generic script whenever there's no equivalent. chfttp and cfheader, mainly. And it's documented on the page for the cfscript tag. In the section "Script support for tags":
ColdFusion traditionally allowed you to build your applications using simple tags. ColdFusion 11 allows you to write all the tags in the script format in a very generic manner.
and then goes on to show examples. https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-r-s/cfscript.html