The following example shows how to invoke component methods in CFScript:
<!--- Instantiate once and reuse the instance.---> <cfscript> tellTimeObj=CreateObject("component","tellTime"); WriteOutput("Server's Local Time: " & tellTimeObj.getLocalTime()); WriteOutput("<br> Calculated UTC Time: " & tellTimeObj.getUTCTime()); </cfscript>
In the example, the three CFScript statements do the following:
In CFScript, you use the method name in standard function syntax, such as methodName().