Robert,

Pound signs are used to "output" variables where you want them "display" or
(in some cases) to concatenate and create a new variable.  They are never
used on the left side of an assigment statement.


        ....wrong...
<cfset #x# = 'blah'>
        ...right....
<cfset x = 'blah'>

        .... wrong....
<cfif #form.x# IS 'blah'>
        ..... right.....
<cfif Form.x IS 'blah'>


        Some folks "might" use them for dynamic evaluation - to determine a
variable name at run time.  For example:


        <cfif Structkeyexists("#x#")>


        This is also unnessasary in this case because X can stand alone as in...

        <cfif Structkeyexist(x)>

        One case where it is "sometimes" acceptable is when you are building an
entirely new string on the fly for  dynamic evaluation.  For example:


        <cfif IsDefined("Form.checkbox_#x#")>

        This sometimes comes into play when you have a series of form elelements
generated from a query and you want access them at runtime without knowing
in advance how many of them there are - or which items are in the query etc.

For the most part, pound signs are unnecessary in about 95% of the cases
INSIDE a CF tag (<cfif>  <Cfset> etc.). Typically they are used just to send
variable values to the output buffer ... .as in <cfoutput>#x#</cfoutput>

-mk



-----Original Message-----
From: Robert Polickoski [mailto:rpolickoski@;isrd.com]
Sent: Friday, November 08, 2002 9:42 AM
To: CF-Talk
Subject: RE: Studio MX


I am fairly new to CFML (3 months).  You mentioned the "rookie use
of pound signs."  How else do you identify variables?

Robert J. Polickoski
Senior Programmer, ISRD Inc.
(540) 842-6339
[EMAIL PROTECTED]
AIM - RobertJFP



---------- Original Message ----------------------------------
From: "Mark A. Kruger - CFG" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date:  Fri, 8 Nov 2002 09:35:02 -0600

>Rick,
>
>Yeah - the file explorer drives me crazy - all the files and
folders
>together... If you have a complex directory structure it means
constantly
>scrolling over to the right to find the right file.
>
>Something else - DWMX has a bunch of wizards to write CF code.
One I saw
>one demonstrated that was the "data-entry" wizard. It built a
form for
>entering records into a database.  You provide the DB and select
the form
>elements etc.  It was based on a recordset that you create.  You
go through
>the wizard and it creates code for you - including validation
code.  But the
>CF code very poor. It actuallly did this on the validation:
>
><cfif #Form.Formname# NEQ "">
>       .... validate blah....
></cfif>
>
>Notice the rookie use of the pound signs.  It made me wonder if
CF server
>folks were involved in the creation of the CF wizards at all.
>
>-mk
>
>P.S. - Studio 5 rocks.
>
>
>
>-----Original Message-----
>From: Rick Root [mailto:rroot@;wakeinternet.com]
>Sent: Friday, November 08, 2002 9:00 AM
>To: CF-Talk
>Subject: Re: Studio MX
>
>
>David Adams wrote:
>> Everyone I know is still using studio and if in a pinch
Homesite MX. In
>> our lives we need more simplicity not complexity.
>
>I guess I missed the rest of this thread but I thought I'd chime
in with
>my opinion.
>
>I don't like Dreamweaver MX.  We have a Site License for it here
at
>Duke, but I simply don't like it.  I don't like the new explorer
layout
>that they use.. I much prefer the directories on top and the
files down
>below.
>
>I'm still using Studio 4.5 and will probably continue to use it
after we
>upgrade to CFMX in the next few weeks.
>
>  - Rick
>
>
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Reply via email to