I come from a C,C++ background so I usually like to keep my structures more
obvious.
the fact that #pattern_name# in cold fusion is a two step search bothers me.
It first looks for a global pattern_name and then for form.pattern_name.
Yuck!
I have had the same problem when doing queries and checking for possible
errors
<cfoutput query="foo">
<cfif bar EQ "">
<cfset bar=0>
</cfif>
</cfoutput>
This looked good to me at first, but then cf is really doing an assignment
to a global bar, not to the query's bar. CF is not very clear on their
scoping rules. As a rule, keep it explicit, and not mix variables as you
do.
(Here it comes the flame... I am ducking already.)
<Jaime/>
> -----Original Message-----
> From: BORKMAN Lee [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 01, 2000 3:40 PM
> To: CF-Talk
> Subject: RE: " symbol Vs. "
>
>
> No Jaime,
>
> this kind of replace works just fine:
> <CFSET x=replace(x, 'me', 'you', 'all')>
>
> I use it happily all the time. It's as valid as <CFSET x=x+1>
>
> I think Michael just has a scoping problem, mixing FORM scope with local
> variables, that's all.
>
> Lee (Bjork) Borkman
> http://bjork.net ColdFusion Tags by Bjork
>
>
> -----Original Message-----
> From: Jaime Garza [mailto:[EMAIL PROTECTED]]
>
> I have dealt with this case before. I don't think it's the replace. But
> rather that the cfset will not replace pattern_name just like that.
>
> Try <cfset tmp_pattern_name=...> and then on your values instead of
> '#Form.pattern_name#' use '#tmp_pattern_name#'
>
> I hope it helps.
>
>
> IMPORTANT NOTICE:
> This e-mail and any attachment to it is intended only to be read
> or used by
> the named addressee. It is confidential and may contain legally
> privileged
> information. No confidentiality or privilege is waived or lost by any
> mistaken transmission to you. If you receive this e-mail in error, please
> immediately delete it from your system and notify the sender.
> You must not
> disclose, copy or use any part of this e-mail if you are not the intended
> recipient. The RTA is not responsible for any unauthorised alterations to
> this e-mail or attachment to it.
> ------------------------------------------------------------------
> ------------------------------
> Archives: http://www.mail-archive.com/[email protected]/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
> or send a message with 'unsubscribe' in the body to
> [EMAIL PROTECTED]
>
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
with 'unsubscribe' in the body to [EMAIL PROTECTED]