Copy link to clipboard
Copied
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?
You can't.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
You can't.
Copy link to clipboard
Copied
Yeah... I noticed that, well what I did was that I moved my function after the variables are declared... thanks guys!