Lose the var, just use myvarname = "..."

I couldn't find this stated in the docs but it's what works for me. Or use
<cfparam outside of  <cfscript

-----Original Message-----
From: Joshua Miller [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 2:53 AM
To: CF-Talk
Subject: RE: var in cfscript??


I think in order for VAR to be useful it has to be within a FUNCTION
correct?

Like so:

<cfscript>
function thisFunc(){
        var i=1;
}
</cfscript>

Joshua Miller
Head Programmer / IT Manager
Garrison Enterprises Inc.
www.garrisonenterprises.net
[EMAIL PROTECTED]
(704) 569-9044 ext. 254
 
************************************************************************
*************
Any views expressed in this message are those of the individual sender,
except where the sender states them to be the views of 
Garrison Enterprises Inc.
 
This e-mail is intended only for the individual or entity to which it is
addressed and contains information that is private and confidential. If
you are not the intended recipient you are hereby notified that any
dissemination, distribution or copying is strictly prohibited. If you 
have received this e-mail in error please delete it immediately and
advise us by return e-mail to [EMAIL PROTECTED]
************************************************************************
*************


-----Original Message-----
From: Taco Fleur [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 25, 2003 1:35 AM
To: CF-Talk
Subject: var in cfscript??


Anyone any idea why I am getting errors when initializing my variables
with "var" in cfscript? Scripts that worked before now do not allow the
var keyword anymore...

I was getting this a couple of days ago, just ignored it as I could not
figure what in godsname was wrong. Now it's sort of getting annoying,
just started a complete new project from BLANK type in var and get an
error again..

Following is one of the codes that generate the error.
--------
<cfscript>
 var location = "<a href=""index.cfm"">Home</a> &raquo; <a
href=""index.cfm?fuseaction=Search"">Search</a>";
 var bAppend = false;
 if ( url.searchType IS "advanced" )
 {
  location = location & " &raquo; <a
href=""index.cfm?fuseaction=search&searchType=advanced"">Advanced</a>";
  bAppend = true;
 }
................................more code
</cfscript>

The error I get is:
just in time compilation error 
Invalid parser construct found on line 3 at position 2. ColdFusion was
looking at the following text:

var





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Get the mailserver that powers this list at http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to