Johnny,

Any examples that you might have would be most helpful, as I have a
Friday deadline for this...

Thanks,

- Gary

-----Original Message-----
From: Johnny Thompson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 26, 2001 5:17 PM
To: [EMAIL PROTECTED]
Subject: RE: Quick Array help please!


just a quick pointer from having struggled with arrays myself for many
hours..

instead of setting values equal to elements in a two-dimensional array,
I
would strongly suggest setting them equal to keys in a structure then
storing the structure in a single-dimension array.



--- "Houk, Gary" <[EMAIL PROTECTED]> wrote:
> Maybe this will help...I just got a little further...
> 
> -------------------Here is the array I
have:----------------------------
> 
> <cfset session.ratestdatadetails=ArrayNew(2)>
> <cfset session.detailrecordcount="#details.recordcount#">
> 
> <cfoutput query="details">
> <cfset session.ratestdatadetails[ArrayLen(session.ratestdatadetails)
> +1][1]="#details.item#">
> <cfset session.ratestdatadetails[ArrayLen(session.ratestdatadetails)
> ][2]="#details.description#">
> <cfset session.ratestdatadetails[ArrayLen(session.ratestdatadetails)
> ][3]="#details.order_qty#">
> <cfset session.ratestdatadetails[ArrayLen(session.ratestdatadetails)
> ][4]="#ArrayLen(session.ratestdatadetails)#">
> <cfset session.ratestdatadetails[ArrayLen(session.ratestdatadetails)
> ][5]="#details.selling_price#">
> </cfoutput> 
> 
> --------Here is how I output it---------------------
>                               
> <cfloop index="Counter" from="1" to="#session.detailrecordcount#">
>       <cfoutput>
>               <tr>
>               <td><font size="1"
> face="arial">#session.ratestdatadetails[Counter][1]#</font></td>
>               <td><font size="1"
> face="arial">#session.ratestdatadetails[Counter][2]#</font></td>
>               <td align="center"><font size="1"
>
face="arial">#numberformat(session.ratestdatadetails[Counter][3])#</font
> ></td>(qty line)      <td align="center"><input type="text" size="2"
> name="#numberformat(session.ratestdatadetails[Counter][4])#"></td>
>               <td align="right"><font size="1"
>
face="arial">#dollarformat(session.ratestdatadetails[Counter][5])#</font
> ></td>
>               </tr>
>       </cfoutput>
> </cfloop>
> 
> Okay, I can take the code above where I output it and just place it in
> the action page of the form to display it. The problem is that the
line
> where I put (qty line) as a marker, needs to change to display the
> output of the text that was placed in it from the form. 
> 
> How do I go about updating the array to show this line item?
> After that, How do I loop over this to put all of the information back
> into a database?
> 
> - Gary
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 26, 2001 11:56 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Quick Array help please!
> 
> 
> Gary-
> 
> I'm not quite sure I understand your problem, but based on what I do
> understand, I would do something like the following:
> 
> 1.  Have the stored procedure return the values you've listed, plus
the
> key value for each record returned from the table.
> 
> 2.  As you are outputting the results of the stored procedure, create
a
> hidden form field that holds the key value for the record along with
the
> text input for the received amount.
> 
> 3.  Submit the form to the action page.
> 
> 4.  Loop through the form fields array and execute an UPDATE statement
> (or stored procedure) for the received amount using the key value from
> the hidden form field.
> 
> This may not be the most efficient solution, but make use of the
arrays
> that already exist instead of having to manage an array that you might
> create on your own...
> 
> --IronFury
> 
> 
> 
>
------------------------------------------------------------------------
> -
> This email server is running an evaluation copy of the MailShield
anti-
> spam software. Please contact your email administrator if you have any
> questions about this message. MailShield product info:
> www.mailshield.com
> 
> -----------------------------------------------
> To post, send email to [EMAIL PROTECTED]
> To subscribe / unsubscribe: http://www.dfwcfug.org
> 
>
------------------------------------------------------------------------
-
> This email server is running an evaluation copy of the MailShield
anti-
> spam software. Please contact your email administrator if you have any
> questions about this message. MailShield product info:
> www.mailshield.com
> 
> -----------------------------------------------
> To post, send email to [EMAIL PROTECTED]
> To subscribe / unsubscribe: http://www.dfwcfug.org


=====
------------------------------
Johnny Thompson
Macromedia Certified ColdFusion 5.0 Developer

"My mind is a raging torrent, flooded with rivulets of thought cascading
into a waterfall of creative alternatives."
        - Hedley Lamar
------------------------------

__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo!
Messenger. http://im.yahoo.com

------------------------------------------------------------------------
-
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info:
www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to