-1

I need help converting this ColdFusion Script to ColdFusion Tag.

public any function default(required rc) {
    // rc.varName = 'whatever';
}
Indy
  • 391
  • 1
  • 13
  • 19
  • 3
    Where are you having difficulty? And why do you want to change it to tags? – Adam Cameron Apr 02 '14 at 08:03
  • Hi, I am just very used to using the tag based format for ColdFusion. – user3488345 Apr 02 '14 at 08:10
  • 4
    OK, but back to my first (more relevant question): which part are you struggling with, and (didn't ask this): what have you tried so far. You know how to write a ``, right? And you must have seen script-based functions in the past. So which bits don't you "get" here? – Adam Cameron Apr 02 '14 at 08:12
  • Hey thanks for the response. I am having trouble making rc required in the function. I can do this part the part I am having trouble with is passing rc as required – user3488345 Apr 02 '14 at 08:15
  • 3
    Read: https://wikidocs.adobe.com/wiki/display/coldfusionen/cfargument – Peter Boughton Apr 02 '14 at 08:27
  • 2
    Cool: that makes it more clear. See Mark's answer: the missing piece of the puzzle for you is the `` tag. All of this should have come to you fairly quickly had you read the docs though? The docs page for `` (https://wikidocs.adobe.com/wiki/display/coldfusionen/cffunction) make a point of ushering you to the page on working with components (https://wikidocs.adobe.com/wiki/display/coldfusionen/Building+and+Using+ColdFusion+Components), and also mention `` sufficiently often as to make it obvious it's important info. Did you read the docs before starting this? – Adam Cameron Apr 02 '14 at 08:49
  • Adam, Yes I did read the docs, and it still didn't come to me. Hence the reason I requested help. Fortunately Mark was able to respond with a great answer. – user3488345 Apr 02 '14 at 09:17
  • 1
    When you have read docs state in your question - i.e. "I have read X doc page" - and (if relevant) highlight any particular section/paragraph (e.g. "I don't understand the text in paragraph Y" or "I don't see a section describing Z" or whatever). This demonstrates to readers that you have actually put effort in and are not just being lazy. (Unfortunately SO has many of the latter.) – Peter Boughton Apr 02 '14 at 13:24
  • Why, in the name of all that is holy, would you want to change a script based function into a tag based one? – Scott Stroz Apr 02 '14 at 17:17

1 Answers1

0
<cffunction name="default" access="public" returntype="any">
    <cfargument name="rc" required="true">
    <cfset arguments.rc.varname = "whatever">
</cffunction>
Mark D
  • 543
  • 2
  • 5