Skip to main content
Participating Frequently
August 9, 2011
Answered

Use variables that are defined later on

  • August 9, 2011
  • 2 replies
  • 395 views

Hi Guys!

I'm having some troubles trying to figure out how to use or call a variable that I define later on a website, for example

<cfoutput>#meta#</cfoutput>

<cfset meta=1>

The real case is that meta is being used by other functions and since it's already there I want to take advantage of it and recycle, so how can I call or use a variable that where I want to use It, it hasn't been declare yet?

    This topic has been closed for replies.
    Correct answer Dan_Bracuk

    You can't.

    2 replies

    Dan_BracukCorrect answer
    Inspiring
    August 9, 2011

    You can't.

    IxDelgaAuthor
    Participating Frequently
    August 9, 2011

    Yeah... I noticed that, well what I did was that I moved my function after the variables are declared... thanks guys!

    Inspiring
    August 9, 2011

    This is a very very fundamental question about how programming & web apps are concerned, so best you read some docs:

    Variables:

    http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0999c-7ff0.html

    Using ColdFusion variables:

    http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-7ff2.html

    About scopes:

    http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-7fd5.html

    Creating and using variables in scopes:

    http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-7fd5.html

    About persistent scope variables:

    http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0c35c-7ffb.html

    Configuring and using session variables:

    http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-7c48.html

    Configuring and using application variables

    http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0c35c-7fec.html

    --

    Adam