> but is this what is supppose to happen/intended?

Yes.

Any unscoped variable that is created in a function body is
automatically placed in the variables scope, which is "global" and not
localised to the function, hence future iterations of the same function
can read/overwrite that value.  To localise a variable to the function,
prefix it with "var":

<cffunction name="foo">
    <cfset bar = ""> <!--- "global" (in the variables scope) --->
    <cfset var bar2 = "">  <!--- localised to the function --->
</cffunction>

Further info on scopes is in the livedocs:
http://short.badpen.com/?3LL2SK61

HTH,

Tim.

-------------------------------------------------------
OUR NEW SITE IS NOW LIVE
Visit our new website at http://www.rawnet.com/ and
race around the beautiful Bracknell streets at
http://xmas.rawnet.com/
-------------------------------------------------------
Tim Blair
Web Application Engineer, Rawnet Limited
Direct Phone : +44 (0) 1344 393 441
Switchboard : +44 (0) 1344 393 040
-------------------------------------------------------
This message may contain information which is legally
privileged and/or confidential.  If you are not the
intended recipient, you are hereby notified that any
unauthorised disclosure, copying, distribution or use
of this information is strictly prohibited. Such
notification notwithstanding, any comments, opinions,
information or conclusions expressed in this message
are those of the originator, not of rawnet limited,
unless otherwise explicitly and independently indicated
by an authorised representative of rawnet limited.
-------------------------------------------------------


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to