Skip to content

Instantly share code, notes, and snippets.

@roulupen
Last active December 11, 2015 13:08
Show Gist options
  • Save roulupen/4605443 to your computer and use it in GitHub Desktop.
Save roulupen/4605443 to your computer and use it in GitHub Desktop.
<cfscript>
//function defined in cfm page which will add two number and will return the value
function addTwoNumber(num1, num2) {
return num1 + num2;
}
varriable.x = variables.addTwoNumber; //Function defined in this page is assigned to the variable x
writeOutPut("Call to addTwoNumber : " & varriable.x(10,12)); //Function call to AddTwoNumber by using variable
variables.y = createObject("component", "test").addTwoNum; // Function defined in test.cfc is assigned to variable y
writeOutPut("<br/>Call to addTwoNum :" & variables.y(10,20)); //Function call to addTwoNum by using variable
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment