so, do I need to declare an array in advance, or is this implicit.
so, I guess this does not work either:
cfset LegalProteinSequence_#LoopCount# = ...
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
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:
cfset LegalProteinSequence_#LoopCount# = ...
I gave you several examples of this in another thread:
[LegalProteinSequence_#LoopCount#] = ...
cfset variables[LegalProteinSequence_ LoopCount] = ...
.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
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
Another way:
setVariable(LegalProteinSequence_ loopcount, this-is-a-value);
On Tue, Sep 28, 2010 at 3:42 PM, Rick Colman rcol...@cox.net wrote:
so, do I need to declare an array in advance, or is this implicit.
so, I guess this does not work either:
cfset
#form['ExpOrg_ID_' loopCount]#
On Mon, Sep 27, 2010 at 10:29 PM, Rick Colman rcol...@cox.net 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
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
Larry,
Not sure exactly what you're going for. But rather than go into array usage
(and looping a collection), which you can probably learn better elsewhere,
maybe there's a simpler way to attack the problem.
In the end, you seem to simply want to go over a query result:
cfquery name=GetLats
@larry
try [1st dim][2nd dim] instead of [a,b]
cfset SESSION.Report.Lats[#a#][1] = latID
regards
Bob
From: Stephens, Larry V steph...@indiana.edu
To: cf-talk cf-talk@houseoffusion.com
Sent: Fri, February 5, 2010 4:06:48 PM
Subject: Arrays - humbug! -
Thanks to those who responded. This does fix it. Knew that, forgot it, need to
get it tattooed on me somewhere.
-Original Message-
From: I. Addoum. [mailto:sol_xp...@yahoo.com]
Sent: Friday, February 05, 2010 9:58 AM
To: cf-talk
Subject: Re: Arrays - humbug! - Part 1
@larry
To: cf-talk
Subject: Re: Arrays - humbug! - Part 2
Larry,
Not sure exactly what you're going for. But rather than go into array usage
(and looping a collection), which you can probably learn better elsewhere,
maybe there's a simpler way to attack the problem.
In the end, you seem to simply want
For further manipulation, it's also sometimes handy to remember that a query
object is essentially a struct of arrays, with the selected columns at
struct keys.
So you can also do things like:
cfif Session.Report.lats.recordCount GT 0
cfloop from=1 to #Session.Report.lats.recordCount# index=i
Interesting Will. So does your outer-most structure have some sort of
incremental key? Personally an array of structs seems easier to me
because the array implies a series of something. As far as updating
and the code to deal with them it is pretty much 6 or 1/2 dozen I
would think.
I have a
Hey Jason, if you don't already know which position in the array the
item id is located, then you'll need to loop through the array and
find it. Once found, you are actually dealing with a structure, so
updating is just a simple cfset. Something like this (assuming item id
is in session and new
Hi Matt
Thanks for the reply, you understood correctly. I will now have a play with
your code and post my results. I kind of thought i would have to loop through
the array, but could work out how to update, and at the right position.
Thank you
Hey Jason, if you don't already know which
I find a structure of structures to be better-understood, and easily updated.
I have some example code from my cart if you want it.
Will
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
On Sun, Feb 8, 2009 at 8:04 AM, Will Tomlinson w...@wtomlinson.com wrote:
I find a structure of structures to be better-understood, and easily updated.
Interesting Will. So does your outer-most structure have some sort of
incremental key? Personally an array of structs seems easier to me
An array of structs is effectively a query.
And having it in query form generally makes it easier to handle - much more
powerful sorting and filtering (using QoQ).
~|
Adobe® ColdFusion® 8 software 8 is the most important and
From: Peter Boughton [mailto:bought...@gmail.com]
Sent: Sun 2/8/2009 10:58 AM
To: cf-talk
Subject: Re: Arrays
An array of structs is effectively a query.
And having it in query form generally makes it easier to handle - much more
powerful sorting and filtering (using QoQ
I don't know about speed and memory efficiency, but I would think that
option 3 would be the easiest to work with and offer the best data
integrity.
Of course, I wouldn't write to the SESSION scope in each loop iteration.
I'd write to a local variable and only write to SESSION when it was all
I have inherited this application that stores all the
navigation information
for the web site in a structure within the application
scope. The structure
contains a series of arrays one array for the top
navigation,one for the
side navigation and yet another for the footer
information. The
It looks good but the first line of the script should read:
form.INDEX_TO_DELETE = LISTSORT(form.INDEX_TO_DELETE,NUMERIC,DESC);
OR don't change it and use variables.INDEX_TO_DELETE in the rest of the code
-Oorspronkelijk bericht-
Van: Bosky, Dave [mailto:[EMAIL
Are you deleting backwards? If not, your code will not work. For
example, if you want to remove ites 2 and 4, if you first remove item 2,
the old item 4 is now item 3. If you go backwards (delete 4 then 2),
then this will not happen.
Once you use ArrayDeleteAt, the array is reindexed
try this :-)
cfset idlist = 1,2,3 /
cfset idlistsorted = ListSort(idlist) /
cfloop from=1 to=ArrayLen(myarray) index=i
cfset IDtoDelete = ListGetAt(idlistsorted ,i) - i /
cfset ArrayDeleteAt[IDtoDelete] /
/cfloop
justin
The question should be, is CF better at processing strings or arrays as
lists are only strings.
Ade
-Original Message-
From: Gyrus [mailto:gyrus;rooted.freeuk.com]
Sent: 28 October 2002 12:50
To: CF-Talk
Subject: Arrays vs. Lists
I've a nagging memory of hearing some people hearing
The question should be, is CF better at processing strings or arrays as
lists are only strings.
Kind of begging the question, no? ;-) I'm well aware that lists are
strings - the question stands: Are lists or arrays faster?
Gyrus
[EMAIL PROTECTED]
work: http://www.tengai.co.uk
play:
Arrays :O)
-Original Message-
From: Gyrus [mailto:gyrus;rooted.freeuk.com]
Sent: 28 October 2002 12:56
To: CF-Talk
Subject: Re: Arrays vs. Lists
The question should be, is CF better at processing strings or arrays as
lists are only strings.
Kind of begging the question, no? ;-) I'm
Arrays :O)
Is this:
- Drop everything and go recode your old list loops faster,
- Use arrays rather than lists from now on faster, or
- You may as well use arrays, but don't stress, only P4 chips will
appreciate the time saving faster? ;-)
Gyrus
[EMAIL PROTECTED]
work: http://www.tengai.co.uk
Subject: Re: Arrays vs. Lists
Arrays :O)
Is this:
- Drop everything and go recode your old list loops faster,
- Use arrays rather than lists from now on faster, or
- You may as well use arrays, but don't stress, only P4 chips will
appreciate the time saving faster? ;-)
Gyrus
[EMAIL PROTECTED]
work
Quoting Gyrus [EMAIL PROTECTED]:
I've a nagging memory of hearing some people hearing talking about
how arrays are faster to process in CF than lists. Is this true?
Yes.
Is the difference significant?
Depends. For small lists etc. not really. Really small lists are even
faster as really
, October 28, 2002 12:56 PM
Subject: RE: Arrays vs. Lists
Arrays :O)
-Original Message-
From: Gyrus [mailto:gyrus;rooted.freeuk.com]
Sent: 28 October 2002 12:56
To: CF-Talk
Subject: Re: Arrays vs. Lists
The question should be, is CF better at processing strings or arrays as
lists
- You may as well use arrays, but don't stress, only P4 chips will
appreciate the time saving faster? ;-)
This is the case for most of the this method is faster than that method
arguement. Even then as Neil says it'll only make any real difference if
you're processing thousands.
Stephen
I did some testing and found that converting a big ass list (20k+)
used with numerous listgetat and listsetat, listdeleteat commands to an
array for use with the equivalent array commands, and then back to a list
for storage in the client scope was faster than working with the list in
CFMX.
It looks like you have to do StructNew within the loop for every iteration.
In your code you are only doing that once, for the first array element.
- Original Message -
From: Darren Adams [EMAIL PROTECTED]
!--- query the old newsroom database---
cfquery name=news datasource=newsadmin
I think you need to do it the other wat around - Structures can hold arrays,
I dont think arrays can store structures.
N
!-
Neil Clark
Senior Web Applications Engineer
XML / Cerebro
MCB Digital
Macromedia Alliance Member
Tel: 020 8941 3232
Fax: 020 8941 4333
e-mail:
According to the official Advanced Coldfusion Development course book you
can.
-Original Message-
From: Neil Clark [mailto:[EMAIL PROTECTED]]
Sent: 30 April 2001 16:10
To: CF-Talk
Subject: RE: Arrays and Structures storing query values
I think you need to do it the other wat around
[EMAIL PROTECTED]
-Original Message-
From: Neil Clark [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 30, 2001 11:10 AM
To: CF-Talk
Subject: RE: Arrays and Structures storing query values
I think you need to do it the other wat around - Structures can
hold arrays,
I dont think
]]
Sent: Monday, April 30, 2001 11:10 AM
To: CF-Talk
Subject: RE: Arrays and Structures storing query values
I think you need to do it the other wat around - Structures can
hold arrays,
I dont think arrays can store structures.
N
Darren:
I'm just starting to use structures in CF too, so I'm by no means an
expert, but the code appended below is what I've used to address the
task you asked about -- hope it helps !
-Gerry
Gerard T. Pauline
Mgr, Internet/DB Applications
Computer Systems, DoIT
Pace University
!--- query the old newsroom database---
cfquery name=news datasource=newsadmin dbtype=ODBC
select * from pressreleasetable
ORDER by pressreleasedate DESC
/cfquery
!---Setup an array with a structure ---
cfset oldnews = ArrayNew()
!---add others here later e.g. prsub,prcontent,date etc... ---
Subject: Re: Arrays and Structures storing query values
It looks like you have to do StructNew within the loop for every iteration.
In your code you are only doing that once, for the first array element.
- Original Message -
From: Darren Adams [EMAIL PROTECTED]
!--- query the old
I think you need to do it the other way around - Structures
can hold arrays, I dont think arrays can store structures.
No, arrays can contain structures, just as structures can contain arrays.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202)
Yep your correct !!
Also I needed to put a one in the ArrayNew() declaration.
Cheers !
-Original Message-
From: stas [mailto:[EMAIL PROTECTED]]
Sent: 30 April 2001 16:00
To: CF-Talk
Subject: Re: Arrays and Structures storing query values
It looks like you have to do StructNew within
sure they can, i do it all the time.
cfset astAuthors = arrayNew(1)
cfset astAuthors[1] = structNew()
cfset astAuthors[1].firstname = 'jeff'
cfset astAuthors[1].lastname = 'tapper'
cfset astAuthors[2] = structNew()
cfset astAuthors[2].firstname = 'ben'
cfset astAuthors[2].lastname = 'forta'
This is the CF forum, not the Spectra forum ;)
- Original Message -
From: Raymond Camden [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Monday, April 30, 2001 11:12 AM
Subject: RE: Arrays and Structures storing query values
MacroMedia Representitive
Doh. Just think the other way around is more suited? maybe not?
whatdoiknow!!! :-(
!-
Neil Clark
Senior Web Applications Engineer
XML / Cerebro
MCB Digital
Macromedia Alliance Member
Tel: 020 8941 3232
Fax: 020 8941 4333
e-mail: [EMAIL PROTECTED]
Yep !
Thats the fella
-Original Message-
From: Robert Segal [mailto:[EMAIL PROTECTED]]
Sent: 30 April 2001 16:20
To: CF-Talk
Subject: RE: Arrays and Structures storing query values
Code should look this:
!--- query the old newsroom database---
cfquery name=news datasource=newsadmin
UIN : 3679482
My ally is the Force, and a powerful ally it is. - Yoda
-Original Message-
From: Dave f [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 30, 2001 11:35 AM
To: CF-Talk
Subject: Re: Arrays and Structures storing query values
This is the CF forum, not the Spectra forum
-Original Message-
From: Neil Clark [mailto:[EMAIL PROTECTED]]
Sent: 30 April 2001 16:44
To: CF-Talk
Subject: RE: Arrays and Structures storing query values
Doh. Just think the other way around is more suited? maybe not?
whatdoiknow!!! :-(
!-
Neil
Darren,
Try looking at the problem differently. You can treat your query as
structure of arrays. If you do this you won't have to do any conversion
at all. Simply set up a for () or cfloop from to index loop and out
put only the values you want.
cfloop from=1 to=#news.recordcount# index=i
If it's a one-dimensional array, you could do this:
cfloop from="1" to="#ArrayLen( array_name )#" index="i"
#array_name[i]#br
/cfloop
For a two-dimensional array, you could do this:
cfloop from="1" to="#ArrayLen( array_name )#" index="aRow"
cfloop from="1" to="#ArrayLen( array_name[aRow]
How would i display the entire contents of an array?
Use CF_Show to output it on screen (Developers Exchange).
And looking at the source code might give you an idea of how to code what
you're after.
--
Aidan Whitehall [EMAIL PROTECTED]
Netshopper UK Ltd
Advanced Web Solutions Services
the evaluation function works
try this:
CFSET MyNewArray = ArrayNew(2)
CFSET MyNewArray[1][1] = "Sample Value"
CFSET MyNewArray[1][2] = "43"
CFSET MyNewArray[2][1] = "Sample Value 2"
CFSET MyNewArray[2][2] = "432"
cfset items="[2][2]"
cfoutput#evaluate('MyNewArray#items#')#/cfoutput
Juandres
PROTECTED]]
Sent: Wednesday, 27 September 2000 6:17 PM
To: CF-Talk
Subject: RE: arrays
the evaluation function works
try this:
CFSET MyNewArray = ArrayNew(2)
CFSET MyNewArray[1][1] = "Sample Value"
CFSET MyNewArray[1][2] = "43"
CFSET MyNewArray[2][1] = "Sample Value
Have you considdered using a Structure in stead of an array?
You can then i believe use StructKeyExists to test with a key has been
created
-Original Message-
From: Chris Farrugia [mailto:[EMAIL PROTECTED]]
Sent: 29 June 2000 02:05
To: [EMAIL PROTECTED]
Subject: Arrays and CFIF
I have
This error means literally what it says. The 21st element never got added!
Once there is
something there your code might still fail :)
At 09:04 PM 28/06/00 -0400, you wrote:
How can I do that? The code I'm trying is:
CFIF len(#ProductIDArray[21][2]#) IS NOT 0
This comes back with the
Hello Chris,
The error message is pretty straight forward: It is telling you that array index value
21 does not exist.
It is telling you that you have index values of 1 through to and including 20. So
before you can check for a value you must create the array element.
What you could do is
The best way to diagnose an error like this is to display the array. Check
out a custom tag called cf_objectdump. It will show you an array, query,
or structure. Makes working with complex data structures *much* easier.
Or, if you have Spectra, may I also recommend a custom tag that is part
I have the datetime set in the database to automatically set it whenever a
new record is made so I don't have to worry about it anymore.
-Original Message-
From: Jeff Beer [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 22, 2000 1:17 AM
To: [EMAIL PROTECTED]
Subject: RE: Arrays
Instead of using #CFID# in the insert statement. use #URL.CFID# and
#URL.CFTOKEN# and make sure you are passing the parameters on the url from
the previous form
Kalyan Vemula
Web Developer
STONEAGE.COM
Voice: (800)786-6324 x149
Email: [EMAIL PROTECTED]
http://www.stoneage.com
-Original
0 12:58 PM
Subject: Re: Arrays, databases, and WDDX
Its not an Access version problem is ist?
D:\FTP\chrisf\Database\bwpc.mdb
At 12:46 AM 22/06/00 -0400, you wrote:
Hello Everyone,
I am building a system configurator for a site, but I keep having this
error
I can't figure out. To see the
The error message from ODBC seems to imply that Access is expecting a
datetime value in CFID. Have you tried adding a date manually?
-Original Message-
From: Chris Farrugia [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 22, 2000 2:47 AM
To: [EMAIL PROTECTED]
Subject: RE: Arrays
Hi Chris,
The error I saw indicated a problem with the Date field trying to accept the
CFID field info.
( i.e. [Microsoft][ODBC Microsoft Access Driver] Syntax error in date in
query expression '#CFID#')
Perhaps you have to adjust the order in which your INSERT or UPDATE is
receiving this
This is a multi-part message in MIME format.
--=_NextPart_000_0011_01BFDC49.94F5E710
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Since it is a database error the way I would recommend trying to solve this
problem is by first trying to get the
Yeah, I tried that too but it didn't work.
-Original Message-
From: Jeff Beer [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 22, 2000 8:31 AM
To: [EMAIL PROTECTED]
Subject: RE: Arrays, databases, and WDDX
The error message from ODBC seems to imply that Access is expecting a
datetime
Its not an Access version problem is ist?
D:\FTP\chrisf\Database\bwpc.mdb
At 12:46 AM 22/06/00 -0400, you wrote:
Hello Everyone,
I am building a system configurator for a site, but I keep having this error
I can't figure out. To see the error, go to www.bluewaterpc.com then click
"SOHO
Its Access 2000... Would that make a difference?
-Original Message-
From: Mark Ireland [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 22, 2000 12:59 AM
To: [EMAIL PROTECTED]
Subject: Re: Arrays, databases, and WDDX
Its not an Access version problem is ist?
D:\FTP\chrisf\Database
EcoBuild it, they will come. -
- http://www.ecobuilder.com/ -
---
-Original Message-
From: Chris Farrugia [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 21, 2000 10:00 PM
To: [EMAIL PROTECTED]
Subject: RE: Arrays, databases, and WDDX
You mentioned "datetime" in your text - where is it used in the code?
-Original Message-
From: Chris Farrugia [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 22, 2000 12:47 AM
To: [EMAIL PROTECTED]
Subject: Arrays, databases, and WDDX
Hello Everyone,
I am building a system
Chris
You may be experiencing a problem in that the serialized WDDX data
contains single quote character which would really screw up the SQL
query.
Or the WDDX packet exceeds the size of the memo field (some versions
of Access are notorious for arbitrarily truncating memo fields).
The best
Okay I have a form/table that I build from an array. What I
need to do is create some one the fly math for inverse cells
of this table. that is, if the value of row 1 column 2 is
input to be 2, then the value of row 2 column 1 must be .50.
So I need to write some javascript that takes the
I've heard others here opine they like WDDX for this purpose.
best, paul
At 08:47 AM 3/31/00 -0500, you wrote:
I would like your opinions on whether a shopping cart app should pass
cart contents as arrays or stored in the database.
I'm in the middle of writing a store at the mo. What I'm doing is to store
the shopping basket in a session variable as an array of structs - One array
elementy per item containing a structure of item properties (code,
description, price, etc.). Once a site visitor chooses to purchase then the
I have two clients that wanted to know what people picked but did not
purchase. They wanted to know what was left in the basket, so to
speak. I had to construct the basked as a DB table which moves the
purchased items to the purchased table after they bought them.
Best Regards,
Dennis Powers
73 matches
Mail list logo