Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9170459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:01:20+00:00 2026-06-17T16:01:20+00:00

I am trying to return two variables in a ColdFusion function. I know you

  • 0

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>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:01:21+00:00Added an answer on June 17, 2026 at 4:01 pm

    My preferred method is to return back a struct with the appropriate key/value pairs.

    <cfscript>
    
        function browserDetect(arg1,arg2) {
          var resultStruct = structNew() ;
          resultStruct.browser="some value string";
          resultStruct.version="some other value string";
    
          return resultStruct ;
        }
    </cfscript>
    

    Instead of creating a local struct, you could also return back the results using an explicit struct

    return { browser : "some value string" , version : "some other value string" }
    

    Set resultVar to the results of your function and then you would then just output using

    <cfoutput>#resultvar.browser# and #resultVar.version#</cfoutput>
    

    You could also create a JSON string and return that back .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I am trying to return two variables from a function using the following
i'm trying to compare the content of two variables in order to return if
I'm setting two local variables inside of a jQuery .load(function(){...}) handler, but I can't
I have two variables - Destination and Source - and, using Phonegap, I'm trying
Hi I am trying to use the list() function to retrieve two variables from
I am trying to return two json sets from java which each contain key/value
I'm trying to return two ref cursors from a procedure and having a bit
I am trying to compare two vector objects, and return a single vector containing
I'm trying to create a method that will sum two timeO objects and return
Im trying to return the value that a $ajax call returns, from a function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.