> What happens if it is passed in with a non-numeric value ...

   Wouldn't happen...the variable is used only on a page which
   is submitting back to itself.  No other pages are utilizing it.
   Its default is set to 0, the formula runs, adding 1 to the value,
   and then it gets incremented up 1 if the "Add Another Photo"
   button is clicked...

   Trying to work out a CF solution to allowing a user to add more
   CFFILE fields to a page when they click a button.

   When the page is submitted back to itself, the variable is upped 1,
   and a CFLOOP is run creating the amount of CFFILE fields
   specified by the variable, "Photos".

   Seems simple...but so far it's not working.  I'm just missing
   something at this point...

   Rick



-----Original Message-----
From: Aaron Rouse [mailto:[EMAIL PROTECTED]
Sent: Monday, April 04, 2005 12:48 PM
To: CF-Talk
Subject: Re: Anything wrong with this statement?


I'd think "importance" would be subjective as to who was looking at
it.  I personally try to always do it like this:

<cfset Photos = Variables.Photos + 1 />

But I got into the habbit of putting in Variables due to working with
inherited code that lacks much of any scoping.  So I'd maybe come
across a page with references to Photos but have no idea if they were
expecting it to come in via the URL, FORM, or whatever.  In some
really rare cases they might have had:

<cfparam name="Photos" default="0" />

But I'd still not have any idea where they were expecting it to come
from with that.

All your CFPARAM is doing before the set is making Photos if it did
not already exist and setting it to 0.  What happens if it is passed
in with a non-numeric value ...

On Apr 4, 2005 11:43 AM, Rick Faircloth <[EMAIL PROTECTED]> wrote:

>
> As to scoping it with variables., as in "variables.photos", why
> is that important?
>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:201394
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to