Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Use variables that are defined later on

New Here ,
Aug 09, 2011 Aug 09, 2011

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?

363
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Aug 09, 2011 Aug 09, 2011

You can't.

Translate
LEGEND ,
Aug 09, 2011 Aug 09, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 09, 2011 Aug 09, 2011

You can't.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 09, 2011 Aug 09, 2011
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources