Re: The _ character in variable names
the _ character is indeed legal in CF Yup. I did manage to run into an instance where ColdFusion would throw an error when trying to create or reference a variable name begining with an underscore though. I can't remember where but it may have been a query cfloop: cfloop query=_theQuery. Should have written it down! I just ran into the situation where the underscore causes a problem so I thought I'd right it down this time ;) Lo and behold it is when doing a query of queries(!) when the query name begins with an underscore; try running the following and you get an error: cfset _qTarts = Querynew('') cfset QueryAddColumn(_qTarts, 'flavours', ListToArray('strawberry,lemon,blackcurrant,fruits of the forest')) cfquery name=myQoQ dbtype=query SELECT * FROM _qTarts /cfquery cfdump var=#myQoQ# Change it to this and all is dandy: cfset _qTarts = Querynew('') cfset QueryAddColumn(_qTarts, 'flavours', ListToArray('strawberry,lemon,blackcurrant,fruits of the forest')) cfset qTartsReference = _qTarts cfquery name=myQoQ dbtype=query SELECT * FROM qTartsReference /cfquery cfdump var=#myQoQ# Hope this reference helps somebody pulling their hair out ;) Dominic -- Blog it up: http://fusion.dominicwatson.co.uk ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299802 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
The _ character in variable names
Hello everyone, I have an application I need to get up and running ASAP. We've been trying to create it using PHP. Right now I feel like I'm Beowulf and that PHP application is Grendle. I have created email applications using ColdFusion and got them to run. I'm considering using ColdFusion to sleigh that dragon so we can get the app up and running this weekend and freeing us up to continue to debug the PHP version. It will also allow the organization in question to carry on its business. Some of the variable names include the _character such as first_name. Is this a legal syntax in ColdFusion allowing me to use something like #first_name# to designate the variables in the form processor? Thanks for the help. Peter Donahue - Original Message - From: Charlie Griefer [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Wednesday, January 23, 2008 8:24 PM Subject: Re: CF MX8: This is driving me nuts!!! On Jan 23, 2008 12:24 PM, Rick Root [EMAIL PROTECTED] wrote: It's another reason I hate MS Access. Retarded error messages. And that's an insult to retarded people everywhere. hey i'm offended! -- Evelyn the dog, having undergone further modification pondered the significance of short-person behaviour in pedal depressed, pan-chromatic resonance, and other highly ambient domains. Arf, she said. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297275 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: The _ character in variable names
On Jan 23, 2008 11:11 PM, Peter Donahue [EMAIL PROTECTED] wrote: Hello everyone, I have an application I need to get up and running ASAP. We've been trying to create it using PHP. Right now I feel like I'm Beowulf and that PHP application is Grendle. I have created email applications using ColdFusion and got them to run. I'm considering using ColdFusion to sleigh that dragon so we can get the app up and running this weekend and freeing us up to continue to debug the PHP version. It will also allow the organization in question to carry on its business. Some of the variable names include the _character such as first_name. Is this a legal syntax in ColdFusion allowing me to use something like #first_name# to designate the variables in the form processor? Thanks for the help. yes. -- Evelyn the dog, having undergone further modification pondered the significance of short-person behaviour in pedal depressed, pan-chromatic resonance, and other highly ambient domains. Arf, she said. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297277 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: The _ character in variable names
Peter... the _ character is indeed legal in CF, but beware. The use of _ in combination with certain key words, can trigger ColdFusion's built in validation. Specifically when you're using it with words like date or time. I've spent hours trying to figure out why the validation was being used when it turns out that the variable name itself was at fault. andy -Original Message- From: Peter Donahue [mailto:[EMAIL PROTECTED] Sent: Thursday, January 24, 2008 1:12 AM To: CF-Talk Subject: The _ character in variable names Hello everyone, I have an application I need to get up and running ASAP. We've been trying to create it using PHP. Right now I feel like I'm Beowulf and that PHP application is Grendle. I have created email applications using ColdFusion and got them to run. I'm considering using ColdFusion to sleigh that dragon so we can get the app up and running this weekend and freeing us up to continue to debug the PHP version. It will also allow the organization in question to carry on its business. Some of the variable names include the _character such as first_name. Is this a legal syntax in ColdFusion allowing me to use something like #first_name# to designate the variables in the form processor? Thanks for the help. Peter Donahue - Original Message - From: Charlie Griefer [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Wednesday, January 23, 2008 8:24 PM Subject: Re: CF MX8: This is driving me nuts!!! On Jan 23, 2008 12:24 PM, Rick Root [EMAIL PROTECTED] wrote: It's another reason I hate MS Access. Retarded error messages. And that's an insult to retarded people everywhere. hey i'm offended! -- Evelyn the dog, having undergone further modification pondered the significance of short-person behaviour in pedal depressed, pan-chromatic resonance, and other highly ambient domains. Arf, she said. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297291 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: The _ character in variable names
it isn't variable names that you need to worry about in this special case, just form (or url?) field names. That, I think, is an important difference. (And yes, it totally sucks to find out that you just spent a day tracking down this issue. Been there.) Thanks Mark -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Thursday, January 24, 2008 9:19 AM To: CF-Talk Subject: RE: The _ character in variable names Peter... the _ character is indeed legal in CF, but beware. The use of _ in combination with certain key words, can trigger ColdFusion's built in validation. Specifically when you're using it with words like date or time. I've spent hours trying to figure out why the validation was being used when it turns out that the variable name itself was at fault. andy -Original Message- From: Peter Donahue [mailto:[EMAIL PROTECTED] Sent: Thursday, January 24, 2008 1:12 AM To: CF-Talk Subject: The _ character in variable names Hello everyone, I have an application I need to get up and running ASAP. We've been trying to create it using PHP. Right now I feel like I'm Beowulf and that PHP application is Grendle. I have created email applications using ColdFusion and got them to run. I'm considering using ColdFusion to sleigh that dragon so we can get the app up and running this weekend and freeing us up to continue to debug the PHP version. It will also allow the organization in question to carry on its business. Some of the variable names include the _character such as first_name. Is this a legal syntax in ColdFusion allowing me to use something like #first_name# to designate the variables in the form processor? Thanks for the help. Peter Donahue - Original Message - From: Charlie Griefer [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Wednesday, January 23, 2008 8:24 PM Subject: Re: CF MX8: This is driving me nuts!!! On Jan 23, 2008 12:24 PM, Rick Root [EMAIL PROTECTED] wrote: It's another reason I hate MS Access. Retarded error messages. And that's an insult to retarded people everywhere. hey i'm offended! -- Evelyn the dog, having undergone further modification pondered the significance of short-person behaviour in pedal depressed, pan-chromatic resonance, and other highly ambient domains. Arf, she said. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297294 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: The _ character in variable names
Right...he was specifically asking about form variables, so that's what I meant. Thanks for clarifying though Mark. -Original Message- From: Gaulin, Mark [mailto:[EMAIL PROTECTED] Sent: Thursday, January 24, 2008 8:30 AM To: CF-Talk Subject: RE: The _ character in variable names .it isn't variable names that you need to worry about in this special case, just form (or url?) field names. That, I think, is an important difference. (And yes, it totally sucks to find out that you just spent a day tracking down this issue. Been there.) Thanks Mark -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Thursday, January 24, 2008 9:19 AM To: CF-Talk Subject: RE: The _ character in variable names Peter... the _ character is indeed legal in CF, but beware. The use of _ in combination with certain key words, can trigger ColdFusion's built in validation. Specifically when you're using it with words like date or time. I've spent hours trying to figure out why the validation was being used when it turns out that the variable name itself was at fault. andy -Original Message- From: Peter Donahue [mailto:[EMAIL PROTECTED] Sent: Thursday, January 24, 2008 1:12 AM To: CF-Talk Subject: The _ character in variable names Hello everyone, I have an application I need to get up and running ASAP. We've been trying to create it using PHP. Right now I feel like I'm Beowulf and that PHP application is Grendle. I have created email applications using ColdFusion and got them to run. I'm considering using ColdFusion to sleigh that dragon so we can get the app up and running this weekend and freeing us up to continue to debug the PHP version. It will also allow the organization in question to carry on its business. Some of the variable names include the _character such as first_name. Is this a legal syntax in ColdFusion allowing me to use something like #first_name# to designate the variables in the form processor? Thanks for the help. Peter Donahue - Original Message - From: Charlie Griefer [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Wednesday, January 23, 2008 8:24 PM Subject: Re: CF MX8: This is driving me nuts!!! On Jan 23, 2008 12:24 PM, Rick Root [EMAIL PROTECTED] wrote: It's another reason I hate MS Access. Retarded error messages. And that's an insult to retarded people everywhere. hey i'm offended! -- Evelyn the dog, having undergone further modification pondered the significance of short-person behaviour in pedal depressed, pan-chromatic resonance, and other highly ambient domains. Arf, she said. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297296 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: The _ character in variable names
Boosted from livedocs: Variable naming rules ColdFusion variable names, including form field names and custom function and ColdFusion component argument names, must conform to Java naming rules and the following guidelines: * A variable name must begin with a letter, underscore, or Unicode currency symbol. * The initial character can by followed by any number of letters, numbers, underscore characters, and Unicode currency symbols. * A variable name cannot contain spaces. * A query result is a type of variable, so it overwrites a local variable with the same name. * ColdFusion variables are not case-sensitive. However, consistent capitalization makes the code easier to read. * When creating a form with fields that are used in a query, match form field names with the corresponding database field names. * Periods separate the components of structure or object names. They also separate a variable scope from the variable name. You cannot use periods in simple variable names, with the exception of variables in the Cookie and Client scopes. The following rule applies to variable names, but does not apply to form field and argument names: 1. Prefix each variable's name with its scope. Although some ColdFusion programmers do not use the Variables prefix for local variable names, you should use prefixes for all other scopes. Using scope prefixes makes variable names clearer and increases code efficiency. In many cases, you must prefix the scope. For more information, see About scopes http://livedocs.adobe.com/coldfusion/8/htmldocs/Variables_29.html#1100240. Note: In some cases, when you use an existing variable name, you must enclose it with number signs (#) to allow ColdFusion to distinguish it from string or HTML text, and to insert its value, as opposed to its name. For more information, see Using number signs http://livedocs.adobe.com/coldfusion/8/htmldocs/Expressions_09.html#2708421. Charlie Griefer wrote: On Jan 23, 2008 11:11 PM, Peter Donahue [EMAIL PROTECTED] wrote: Hello everyone, I have an application I need to get up and running ASAP. We've been trying to create it using PHP. Right now I feel like I'm Beowulf and that PHP application is Grendle. I have created email applications using ColdFusion and got them to run. I'm considering using ColdFusion to sleigh that dragon so we can get the app up and running this weekend and freeing us up to continue to debug the PHP version. It will also allow the organization in question to carry on its business. Some of the variable names include the _character such as first_name. Is this a legal syntax in ColdFusion allowing me to use something like #first_name# to designate the variables in the form processor? Thanks for the help. yes. -- *Ryan J. Heldt* /Senior Web Developer/ Global Reach Internet Productions http://www.globalreach.com Phone: 515-296-0792, Fax: 515-296-3748 ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297299 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: The _ character in variable names
the _ character is indeed legal in CF Yup. I did manage to run into an instance where ColdFusion would throw an error when trying to create or reference a variable name begining with an underscore though. I can't remember where but it may have been a query cfloop: cfloop query=_theQuery. Should have written it down! ColdFusion 8 it was and it was definately the underscore for a variable name that was causing the error. I'll investigate when I get 10 mins. Dominic -- Blog it up: http://fusion.dominicwatson.co.uk ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297308 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: The _ character in variable names
Is this a legal syntax in ColdFusion Yes it is. And you can even keep all those [EMAIL PROTECTED] dollar signs in front of all variable names ;-) -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297312 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: The _ character in variable names
While we're on the topic of variable names, you should make sure to use the 'form' scope for post values and the 'url' scope for get values. ColdFusion with find the variables without the scope specified, but you get better code readability and performance when you explicitly use the scope. On Jan 24, 2008 11:11 AM, Claude Schneegans [EMAIL PROTECTED] wrote: Is this a legal syntax in ColdFusion Yes it is. And you can even keep all those [EMAIL PROTECTED] dollar signs in front of all variable names ;-) -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297323 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4