Re: arrays and looping around

2010-09-29 Thread Michael Grant

Another way:

setVariable("LegalProteinSequence_" & loopcount, "this-is-a-value");


On Tue, Sep 28, 2010 at 3:42 PM, Rick Colman  wrote:

>
>  so, do I need to declare an array in advance, or is this implicit.
>
> so, I guess this does not work either:
>
> 
> On 9/27/2010 10:10 PM, Ian Skinner wrote:
> > On 9/27/2010 7:37 PM, Michael Grant wrote:
> >> #form['ExpOrg_ID_'&   loopCount]#
> >>
> > A.K.A. "Array Notation" and can be applied to any variable scope, not
> > just the form scope, though that is probably the most common.
> >
> >
> >
>
> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337628
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: arrays and looping around

2010-09-29 Thread Bobby Hartsfield

No you do not need to declare an array in this case. It is not actually an
array; it is just called "array notation" because it is the same syntax you
would use on an array. FORM is actually a predefined structure/collection
(aka 'scope')... such as URL or VARIABLES scopes

Most variables that you can reference as scope.variable, you can reference
as scope[variable]
 
In your last example: http://acoderslife.com
 
-Original Message-
From: Rick Colman [mailto:rcol...@cox.net] 
Sent: Tuesday, September 28, 2010 3:42 PM
To: cf-talk
Subject: Re: arrays and looping around


  so, do I need to declare an array in advance, or is this implicit.

so, I guess this does not work either:

 On 9/27/2010 7:37 PM, Michael Grant wrote:
>> #form['ExpOrg_ID_'&   loopCount]#
>>
> A.K.A. "Array Notation" and can be applied to any variable scope, not
> just the form scope, though that is probably the most common.
>
>
> 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337622
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: arrays and looping around

2010-09-29 Thread Dave Watts

>  so, do I need to declare an array in advance, or is this implicit.

Existing scopes (Form, Url, Variables, etc) can always be treated this way.

> so, I guess this does not work either:
>
> http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsit

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337615
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: arrays and looping around

2010-09-28 Thread Rick Colman

  so, do I need to declare an array in advance, or is this implicit.

so, I guess this does not work either:

 On 9/27/2010 7:37 PM, Michael Grant wrote:
>> #form['ExpOrg_ID_'&   loopCount]#
>>
> A.K.A. "Array Notation" and can be applied to any variable scope, not
> just the form scope, though that is probably the most common.
>
>
> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337609
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: arrays and looping around

2010-09-27 Thread Ian Skinner

On 9/27/2010 7:37 PM, Michael Grant wrote:
> #form['ExpOrg_ID_'&  loopCount]#
>

A.K.A. "Array Notation" and can be applied to any variable scope, not 
just the form scope, though that is probably the most common.


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337594
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: arrays and looping around

2010-09-27 Thread Michael Grant

#form['ExpOrg_ID_' & loopCount]#



On Mon, Sep 27, 2010 at 10:29 PM, Rick Colman  wrote:

>
>  I can't seem to get this working, and it should not be that tough?
>
> Here what I am trying to do:
>
> * get the number of form variables  coming in
>
> * loop through the number of variables coming in, and as each form
> variable comes in, do a query
>
> * store the results of the query in an another variable
>
> I can't seem to figure out how to attach a "subscript" to a form
> variable name.
>
> Here is what is the kind of thing that is NOT working:
>
> 
>
> 
> select * from table
> where ID = #form.ExpOrg_ID_#LoopCount##
> 
>
> i have tried several variations, and they generate interesting errors.
>
> if someone would be so kind as to map this out for me, I can get over
> the hump.
>
> TNX if you can help.
>
> Rick.
>
> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337593
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm