I'm finally going to write stuff in cfscript, and so I'm starting to write some necessary formatting functions. Here is an example:
Function FormatBoolean(MyBool, Format) { Switch(Format){ Case "YES/NO":{ If (MyBool eq 1) Return "YES"; Else Return "NO"; Break; } Default:{ If (MyBool eq 1) Return "Yes"; Else Return ""; Break; } } }
What I would like to do is make Format an optional argument. If you do not include this argument, the function will still work, but it will not find the format, and it seems that cfparam is not being translated into cfscript.
I just have to check if the format is defined and assign a value to it? Or is there a better way to do this?
thanks
coldfusion coldfusion-9
Limey
source share