I am trying to return two variables in a ColdFusion function.
I know you can do this in C++ using the & sign.
my code:
<cfscript>
function browserDetect(browser,version) {
browser="some value string";
version="some other value string";
}
</cfscript>
other page:
<cfoutput>#BrowserName# and #BrowserVer#</cfoutput>
My preferred method is to return back a struct with the appropriate key/value pairs.
Instead of creating a local struct, you could also return back the results using an explicit struct
Set
resultVarto the results of your function and then you would then just output usingYou could also create a JSON string and return that back .