RE: first time array
A small error in my code > -Original Message- > From: Pascal Peters > Sent: woensdag 30 juni 2004 12:10 > To: CF-Talk > Subject: RE: first time array > > > > > > > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
I am missing the form but I think it is probably something like a loop over 4 textboxes that have the same name. In your action page (code posted) you only create one record, with a comma delimited list of values in it. I suppose you want each line in the form to be a record and create an array from it? Here it comes: The form: Issue Title Date Publication The action page: Record #i# #cassettes_Array[i][j]# The first loop loops the rows, the second loops the columns. Pascal > -Original Message- > From: Tim Laureska [mailto:[EMAIL PROTECTED] > Sent: woensdag 30 juni 2004 11:53 > To: CF-Talk > Subject: RE: first time array > > In experimenting with a 2 dimensional array I used Pascal's > coding example and have the below code now (which works and > generates the correct output) but I don't understand the loop > mechanics. > > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
In experimenting with a 2 dimensional array I used Pascal's coding example and have the below code now (which works and generates the correct output) but I don't understand the loop mechanics. For example: when I enter 8 cassettes in the form feeding this array, I get the following output, which is correct, but don't know why--... can someone breakdown how the cfloops below work? (for instance I thought this output would relect 8 records, not 1). I get totally lost with the 2nd loop ... then one loop is wrapped within another -- whoa! thanks in advance OUTPUT: Record 1 iss1,iss2,iss3,iss4,iss5,iss6,iss7,iss8 cass1,cass2,cass3,cass4,cass5,cass6,cass7,cass8 date1,date2,date3,date4,date5,date6,date7,date8 pub1 Record #i# #cassettes_Array[i][j]# [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: first time array
Frank, Yep, you're going down the right track - that'd pretty much copy elements out of someCollection into your books structure. An example pulling the "books" from a database: SELECT isbn, author, title FROM books -joe [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: first time array
Thanks Joe... I wouldn't mind seeing some code samples of an array of structures... that would be a great help >-Original Message- >From: Joe Rinehart [mailto:[EMAIL PROTECTED] >Sent: Tuesday, June 29, 2004 03:54 PM >To: 'CF-Talk' >Subject: Re: first time array > >Tim, > >Arrays and structure are both good places to store stuff. The >question is what type of stuff you want to store. > >If you just need to store "something," an array can be a good way to >go. If you need to store "something" and "stuff" (properties) about >it, a structure may be a good bet. > >Example: If I wanted to store the ISBN numbers of a bunch of books, >I'd use an array called "books" - books[1] would be the ISBN of the >first book, books[2] the second, and so on. > >If I wanted to store a single book and "stuff" about it, I'd use a >structure - book.ISBN, book.author, book.title, etc. Sure, you could >do this with an array: book[1] being title, book[2] being author, >etc., but then you have to remember that 1 = title, 2=author. Think >of a structure as an array where instead of using numbers for each >element, you use a unique name. > >More powerful still is an array of structures. Going back to the >books example, you could have the books array with book[1] being a >structure, book[2] being a structure, etc., so that you have >book[1].title, book[2].title, book[3].title, and so on. > >Lastly, you can have a structure of structures! Say you developed >the app using the array of structures - then you suddenly need a >feature where you need to access the title of a book in the array by >knowing only its ISBN number. You could create a structure called >"books", and inside put elements using their ISBN number as the name. >So you'd have books["222-442-5534"].title, >books["1232-442-5534"].title, and so on. > >Whew. If you'd like code samples for this, I can type those after lunch. :) > > > > >- Original Message - >From: Tim Laureska <[EMAIL PROTECTED]> >Date: Tue, 29 Jun 2004 10:35:21 -0400 >Subject: RE: first time array >To: CF-Talk <[EMAIL PROTECTED]> > > >Tony... why are structures a better way to go than than arrays > > > > >-Original Message- > >From: Tony Weeg [mailto:[EMAIL PROTECTED] > >Sent: Tuesday, June 29, 2004 10:08 AM > >To: CF-Talk > >Subject: RE: first time array > > > >tim, then there is this GREAT > >thing called a structure, play with this one... > > > > > > > > > > > > > > > > > > > > > > > > > >Hello world, my name is #me.myFirstName# #me.myLastName# and i > >live in #me.myCity# > > > >-Original Message- > >From: Pascal Peters [mailto:[EMAIL PROTECTED] > >Sent: Tuesday, June 29, 2004 10:06 AM > >To: CF-Talk > >Subject: RE: first time array > > > >A 2D array requires 2 indexes. Change the first line to > > > > > >> -Original Message- > >> From: Tim Laureska [mailto:[EMAIL PROTECTED] > >> Sent: dinsdag 29 juni 2004 16:09 > >> To: CF-Talk > >> Subject: RE: first time array > >> > >> Thomas... I changed what I had to this: (but now getting the > >> error below, which is a bit cryptic). > >> > >> > >> > >> > >> > >> > >> > >> Error Diagnostic Information > >> An error occurred while evaluating the _expression_: > >> cassettes_Array[1]=form.issue > >> Error near line 11, column 22. > >> Cannot set element of indexed object > >> > >> The element at position 1 of the object cannot be set. May be > >> the object is read-only. The object has elements in positions > >> 1 through 0. > >> The error is in dimension 1 of object "cassettes_Array". > >> > >> > >> -Original Message- > >> From: Thomas Chiverton [mailto:[EMAIL PROTECTED] > >> Sent: Tuesday, June 29, 2004 9:42 AM > >> To: CF-Talk > >> Subject: Re: first time array > >> > >> On Tuesday 29 Jun 2004 14:42 pm, Tim Laureska wrote: > >> > > >> > > >> > > >> > > >> > > >> > cassettes_Array[ArrayLen(cassettes_Array)+1][4]=#form.publication#> > >> >
RE: first time array
asumming the data structure (where someCollection is an array) : someCollection[1].isbn someCollection[1].title ... someCollection[2].isbn someCollection[2].title ... From: Frank Dewey [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 11:27 AM To: CF-Talk Subject: RE: first time array Joe, I am fairly new to CF also and wanted to see if I understood the concepts correctly. When you get time, can you look over this and let me know if it is correct? I have provided two possible solutions. The difference in the second is that I do not use the temporary variable thisISBN...for syntax questions. OR someCollection[thisBook].title Thank you - Frank From: Joe Rinehart [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:55 AM To: CF-Talk Subject: Re: first time array Tim, Arrays and structure are both good places to store stuff. The question is what type of stuff you want to store. If you just need to store "something," an array can be a good way to go. If you need to store "something" and "stuff" (properties) about it, a structure may be a good bet. Example: If I wanted to store the ISBN numbers of a bunch of books, I'd use an array called "books" - books[1] would be the ISBN of the first book, books[2] the second, and so on. If I wanted to store a single book and "stuff" about it, I'd use a structure - book.ISBN, book.author, book.title, etc. Sure, you could do this with an array: book[1] being title, book[2] being author, etc., but then you have to remember that 1 = title, 2=author. Think of a structure as an array where instead of using numbers for each element, you use a unique name. More powerful still is an array of structures. Going back to the books example, you could have the books array with book[1] being a structure, book[2] being a structure, etc., so that you have book[1].title, book[2].title, book[3].title, and so on. Lastly, you can have a structure of structures! Say you developed the app using the array of structures - then you suddenly need a feature where you need to access the title of a book in the array by knowing only its ISBN number. You could create a structure called "books", and inside put elements using their ISBN number as the name. So you'd have books["222-442-5534"].title, books["1232-442-5534"].title, and so on. Whew. If you'd like code samples for this, I can type those after lunch. :) [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
Joe, I am fairly new to CF also and wanted to see if I understood the concepts correctly. When you get time, can you look over this and let me know if it is correct? I have provided two possible solutions. The difference in the second is that I do not use the temporary variable thisISBN...for syntax questions. OR someCollection[thisBook].title Thank you - Frank From: Joe Rinehart [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:55 AM To: CF-Talk Subject: Re: first time array Tim, Arrays and structure are both good places to store stuff. The question is what type of stuff you want to store. If you just need to store "something," an array can be a good way to go. If you need to store "something" and "stuff" (properties) about it, a structure may be a good bet. Example: If I wanted to store the ISBN numbers of a bunch of books, I'd use an array called "books" - books[1] would be the ISBN of the first book, books[2] the second, and so on. If I wanted to store a single book and "stuff" about it, I'd use a structure - book.ISBN, book.author, book.title, etc. Sure, you could do this with an array: book[1] being title, book[2] being author, etc., but then you have to remember that 1 = title, 2=author. Think of a structure as an array where instead of using numbers for each element, you use a unique name. More powerful still is an array of structures. Going back to the books example, you could have the books array with book[1] being a structure, book[2] being a structure, etc., so that you have book[1].title, book[2].title, book[3].title, and so on. Lastly, you can have a structure of structures! Say you developed the app using the array of structures - then you suddenly need a feature where you need to access the title of a book in the array by knowing only its ISBN number. You could create a structure called "books", and inside put elements using their ISBN number as the name. So you'd have books["222-442-5534"].title, books["1232-442-5534"].title, and so on. Whew. If you'd like code samples for this, I can type those after lunch. :) [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: first time array
Tim, Arrays and structure are both good places to store stuff. The question is what type of stuff you want to store. If you just need to store "something," an array can be a good way to go. If you need to store "something" and "stuff" (properties) about it, a structure may be a good bet. Example: If I wanted to store the ISBN numbers of a bunch of books, I'd use an array called "books" - books[1] would be the ISBN of the first book, books[2] the second, and so on. If I wanted to store a single book and "stuff" about it, I'd use a structure - book.ISBN, book.author, book.title, etc. Sure, you could do this with an array: book[1] being title, book[2] being author, etc., but then you have to remember that 1 = title, 2=author. Think of a structure as an array where instead of using numbers for each element, you use a unique name. More powerful still is an array of structures. Going back to the books example, you could have the books array with book[1] being a structure, book[2] being a structure, etc., so that you have book[1].title, book[2].title, book[3].title, and so on. Lastly, you can have a structure of structures! Say you developed the app using the array of structures - then you suddenly need a feature where you need to access the title of a book in the array by knowing only its ISBN number. You could create a structure called "books", and inside put elements using their ISBN number as the name. So you'd have books["222-442-5534"].title, books["1232-442-5534"].title, and so on. Whew. If you'd like code samples for this, I can type those after lunch. :) - Original Message ----- From: Tim Laureska <[EMAIL PROTECTED]> Date: Tue, 29 Jun 2004 10:35:21 -0400 Subject: RE: first time array To: CF-Talk <[EMAIL PROTECTED]> Tony... why are structures a better way to go than than arrays -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:08 AM To: CF-Talk Subject: RE: first time array tim, then there is this GREAT thing called a structure, play with this one... Hello world, my name is #me.myFirstName# #me.myLastName# and i live in #me.myCity# -Original Message- From: Pascal Peters [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:06 AM To: CF-Talk Subject: RE: first time array A 2D array requires 2 indexes. Change the first line to > -Original Message- > From: Tim Laureska [mailto:[EMAIL PROTECTED] > Sent: dinsdag 29 juni 2004 16:09 > To: CF-Talk > Subject: RE: first time array > > Thomas... I changed what I had to this: (but now getting the > error below, which is a bit cryptic). > > > > > > > > Error Diagnostic Information > An error occurred while evaluating the _expression_: > cassettes_Array[1]=form.issue > Error near line 11, column 22. > Cannot set element of indexed object > > The element at position 1 of the object cannot be set. May be > the object is read-only. The object has elements in positions > 1 through 0. > The error is in dimension 1 of object "cassettes_Array". > > > -Original Message- > From: Thomas Chiverton [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 29, 2004 9:42 AM > To: CF-Talk > Subject: Re: first time array > > On Tuesday 29 Jun 2004 14:42 pm, Tim Laureska wrote: > > > > > > > > > > > > cassettes_Array[ArrayLen(cassettes_Array)+1][4]=#form.publication#> > > That should be > cfset cassettes_Array[1]=form.issue > cfset cassettes_Array[2]=form.title > cfset cassettes_Array[3]=form.date1 > to match your cfloop. > > cfdump var="#cassettes_Array#" is useful for figuring out > what you've just built when constructing nested structures. > -- > Tom Chiverton > Advanced ColdFusion Programmer > > Tel: +44(0)1749 834997 > email: [EMAIL PROTECTED] > BlueFinger Limited > Underwood Business Park > Wookey Hole Road, WELLS. BA5 1AF > Tel: +44 (0)1749 834900 > Fax: +44 (0)1749 834901 > web: www.bluefinger.com > Company Reg No: 4209395 Registered Office: 2 Temple Back > East, Temple Quay, BRISTOL. BS1 6EG. > *** This E-mail contains confidential information for the > addressee only. If you are not the intended recipient, please > notify us immediately. You should not use, disclose, > distribute or copy this communication if received in error. > No binding contract will result from this e-mail until such > time as a written document is signed on behalf of the > company. BlueFinger Limited cannot accept responsibility for > the completeness or accuracy of this message as it has been > transmitted over public networks.*** > > > > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
> > If you're trying to describe the attributes of a single thing, a > > structure usually makes more sense. If, on the other hand, you're > > trying to describe a bunch of items together, an array usually makes > > more sense. If you want to describe the attributes of each item > > within an array, you can create an array of structures. > > OK... so in the case I have... a form where a client enters cassette > reference material into a form (each cassette has 4 attributes... issue > no., cassette title, date and publication title) an array would appear > to be better since there would be upwards of 25-30 cassettes entered at > one time..no? Haven't played with structure yet, so .. If you have a bunch of items (cassettes), it makes sense to store them in an array. If you have things that you want to associate with each cassette, that cassette should be described as a structure. So, it sounds like an array of structures is a good way to describe your data. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ phone: 202-797-5496 fax: 202-797-5444 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
Thanks Charlie... I'll check that out ... thanks to everyone else for explaining arrays and structure options -Original Message- From: Charlie Griefer [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 11:08 AM To: CF-Talk Subject: Re: first time array Hi Tim: If you've got a few minutes, I put together what I think is a pretty decent intro to arrays and structs in CF (3 parter): http://tutorial171.easycfm.com/ http://tutorial172.easycfm.com/ http://tutorial173.easycfm.com/ Hope it helps. Charlie - Original Message - From: "Tim Laureska" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Tuesday, June 29, 2004 7:58 AM Subject: RE: first time array > OK... so in the case I have... a form where a client enters cassette > reference material into a form (each cassette has 4 attributes... issue > no., cassette title, date and publication title) an array would appear > to be better since there would be upwards of 25-30 cassettes entered at > one time..no? Haven't played with structure yet, so .. > > -Original Message- > From: Dave Watts [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 29, 2004 10:52 AM > To: CF-Talk > Subject: RE: first time array > > > Tony... why are structures a better way to go than than arrays > > While I'm not Tony, I wouldn't say that structures are better than > arrays or > vice-versa. They're different, and which is best for you at a specific > time > depends on what you're trying to accomplish. > > If you're trying to describe the attributes of a single thing, a > structure > usually makes more sense. If, on the other hand, you're trying to > describe a > bunch of items together, an array usually makes more sense. If you want > to > describe the attributes of each item within an array, you can create an > array of structures. > > > > > > ... > > > > > > ... > > > > > > > > > > ... > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > phone: 202-797-5496 > fax: 202-797-5444 > > > > > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: first time array
Hi Tim: If you've got a few minutes, I put together what I think is a pretty decent intro to arrays and structs in CF (3 parter): http://tutorial171.easycfm.com/ http://tutorial172.easycfm.com/ http://tutorial173.easycfm.com/ Hope it helps. Charlie - Original Message - From: "Tim Laureska" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Tuesday, June 29, 2004 7:58 AM Subject: RE: first time array > OK... so in the case I have... a form where a client enters cassette > reference material into a form (each cassette has 4 attributes... issue > no., cassette title, date and publication title) an array would appear > to be better since there would be upwards of 25-30 cassettes entered at > one time..no? Haven't played with structure yet, so .. > > -Original Message- > From: Dave Watts [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 29, 2004 10:52 AM > To: CF-Talk > Subject: RE: first time array > > > Tony... why are structures a better way to go than than arrays > > While I'm not Tony, I wouldn't say that structures are better than > arrays or > vice-versa. They're different, and which is best for you at a specific > time > depends on what you're trying to accomplish. > > If you're trying to describe the attributes of a single thing, a > structure > usually makes more sense. If, on the other hand, you're trying to > describe a > bunch of items together, an array usually makes more sense. If you want > to > describe the attributes of each item within an array, you can create an > array of structures. > > > > > > ... > > > > > > ... > > > > > > > > > > ... > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > phone: 202-797-5496 > fax: 202-797-5444 > > > > > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
I would create an array of structures. Pascal > -Original Message- > From: Tim Laureska [mailto:[EMAIL PROTECTED] > Sent: dinsdag 29 juni 2004 16:59 > To: CF-Talk > Subject: RE: first time array > > OK... so in the case I have... a form where a client enters > cassette reference material into a form (each cassette has 4 > attributes... issue no., cassette title, date and publication > title) an array would appear to be better since there would > be upwards of 25-30 cassettes entered at one time..no? > Haven't played with structure yet, so .. > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
You can't have more then 100 lines in a message. When you reply, delete the parts of the original message that are not important to your reply. Pascal > -Original Message- > From: Tim Laureska [mailto:[EMAIL PROTECTED] > Sent: dinsdag 29 juni 2004 16:47 > To: CF-Talk > Subject: RE: first time array > > I keep getting a message about the number of message lines > being too much (over 100)... is this a new CF talk list thing? > > -Original Message- > From: Tony Weeg [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 29, 2004 10:08 AM > To: CF-Talk > Subject: RE: first time array > > tim, then there is this GREAT > thing called a structure, play with this one... > > > > > > > > > > > > > Hello world, my name is #me.myFirstName# > #me.myLastName# and i live in #me.myCity# > > > > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
You should use structures if you want to group info about something (like you are doing) because you have an alphanumerical index that can reflect the content. It makes writing code easier. In your example, you had to remember what 1,2,3 and 4 stands for. If you use a struct this is easier Example: Employee = ArrayNew(1); Employee[1] = "Pascal"; Employee[2] = "Peters"; Here you have to remember 1 stands for first name and 2 for last name Employee = StructNew(); Employee["firstname"] = "Pascal"; Employee.lastname = "Peters"; It is easier to know what employee.firstname means (and makes more readable code). I only use arrays if I need ordered data (that's what they are for). > -Original Message- > From: Tim Laureska [mailto:[EMAIL PROTECTED] > Sent: dinsdag 29 juni 2004 16:35 > To: CF-Talk > Subject: RE: first time array > > Tony... why are structures a better way to go than than arrays > > -Original Message- > From: Tony Weeg [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 29, 2004 10:08 AM > To: CF-Talk > Subject: RE: first time array > > tim, then there is this GREAT > thing called a structure, play with this one... > > > > > > > > > > > > > Hello world, my name is #me.myFirstName# > #me.myLastName# and i live in #me.myCity# > > > > -----Original Message- > From: Pascal Peters [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 29, 2004 10:06 AM > To: CF-Talk > Subject: RE: first time array > > A 2D array requires 2 indexes. Change the first line to > > > > > -Original Message- > > From: Tim Laureska [mailto:[EMAIL PROTECTED] > > Sent: dinsdag 29 juni 2004 16:09 > > To: CF-Talk > > Subject: RE: first time array > > > > Thomas... I changed what I had to this: (but now getting the error > > below, which is a bit cryptic). > > > > > > > > > > > > > > > > Error Diagnostic Information > > An error occurred while evaluating the _expression_: > > cassettes_Array[1]=form.issue > > Error near line 11, column 22. > > Cannot set element of indexed object > > > > The element at position 1 of the object cannot be set. May be the > > object is read-only. The object has elements in positions > > 1 through 0. > > The error is in dimension 1 of object "cassettes_Array". > > > > > > -Original Message- > > From: Thomas Chiverton [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, June 29, 2004 9:42 AM > > To: CF-Talk > > Subject: Re: first time array > > > > On Tuesday 29 Jun 2004 14:42 pm, Tim Laureska wrote: > > > > > > > cassettes_Array[ArrayLen(cassettes_Array)+1][1]=#form.issue#> > > > > cassettes_Array[ArrayLen(cassettes_Array)+1][2]=#form.title#> > > > > cassettes_Array[ArrayLen(cassettes_Array)+1][3]=#form.date1#> > > > > > > > cassettes_Array[ArrayLen(cassettes_Array)+1][4]=#form.publication#> > > > > That should be > > cfset cassettes_Array[1]=form.issue > > cfset cassettes_Array[2]=form.title > > cfset cassettes_Array[3]=form.date1 > > to match your cfloop. > > > > cfdump var="#cassettes_Array#" is useful for figuring out > what you've > > just built when constructing nested structures. > > -- > > Tom Chiverton > > Advanced ColdFusion Programmer > > > > Tel: +44(0)1749 834997 > > email: [EMAIL PROTECTED] > > BlueFinger Limited > > Underwood Business Park > > Wookey Hole Road, WELLS. BA5 1AF > > Tel: +44 (0)1749 834900 > > Fax: +44 (0)1749 834901 > > web: www.bluefinger.com > > Company Reg No: 4209395 Registered Office: 2 Temple Back > East, Temple > > Quay, BRISTOL. BS1 6EG. > > *** This E-mail contains confidential information for the addressee > > only. If you are not the intended recipient, please notify us > > immediately. You should not use, disclose, distribute or copy this > > communication if received in error. > > No binding contract will result from this e-mail until such > time as a > > written document is signed on behalf of the company. BlueFinger > > Limited cannot accept responsibility for the completeness > or accuracy > > of this message as it has been transmitted over public networks.*** > > > > > > > > > > > > > > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
Because 2 is the number of dimensions in ArrayNew(2). If you want one dimension, you have to use ArrayNew(1). You can then still create a 2D array by creating arrays in the first dimension Pascal > -Original Message- > From: Tim Laureska [mailto:[EMAIL PROTECTED] > Sent: dinsdag 29 juni 2004 16:23 > To: CF-Talk > Subject: RE: first time array > > Pascal... your suggestion worked but I thought the # of > dimensions was set in thr last parenthesis... so why isn't > correct? > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
now that's up to you ;) tw -Original Message- From: Tim Laureska [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:59 AM To: CF-Talk Subject: RE: first time array OK... so in the case I have... a form where a client enters cassette reference material into a form (each cassette has 4 attributes... issue no., cassette title, date and publication title) an array would appear to be better since there would be upwards of 25-30 cassettes entered at one time..no? Haven't played with structure yet, so .. -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:52 AM To: CF-Talk Subject: RE: first time array > Tony... why are structures a better way to go than than arrays While I'm not Tony, I wouldn't say that structures are better than arrays or vice-versa. They're different, and which is best for you at a specific time depends on what you're trying to accomplish. If you're trying to describe the attributes of a single thing, a structure usually makes more sense. If, on the other hand, you're trying to describe a bunch of items together, an array usually makes more sense. If you want to describe the attributes of each item within an array, you can create an array of structures. ... ... ... Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ phone: 202-797-5496 fax: 202-797-5444 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
OK... so in the case I have... a form where a client enters cassette reference material into a form (each cassette has 4 attributes... issue no., cassette title, date and publication title) an array would appear to be better since there would be upwards of 25-30 cassettes entered at one time..no? Haven't played with structure yet, so .. -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:52 AM To: CF-Talk Subject: RE: first time array > Tony... why are structures a better way to go than than arrays While I'm not Tony, I wouldn't say that structures are better than arrays or vice-versa. They're different, and which is best for you at a specific time depends on what you're trying to accomplish. If you're trying to describe the attributes of a single thing, a structure usually makes more sense. If, on the other hand, you're trying to describe a bunch of items together, an array usually makes more sense. If you want to describe the attributes of each item within an array, you can create an array of structures. ... ... ... Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ phone: 202-797-5496 fax: 202-797-5444 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
agreed, 100% dave has such an eloquent way of explaining things... I just cant. I use arrays for dumb data, and structures for more intelligent data. I use arrays when I have to order things, add them up, or whatever... I use structures when I have multi-dimensional data that is easier to decipher. anyway, STUDY the heck outta these (Structs and Arrays) since the cfmx cert exam is laden heavily with their syntax etc... tw -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:52 AM To: CF-Talk Subject: RE: first time array > Tony... why are structures a better way to go than than arrays While I'm not Tony, I wouldn't say that structures are better than arrays or vice-versa. They're different, and which is best for you at a specific time depends on what you're trying to accomplish. If you're trying to describe the attributes of a single thing, a structure usually makes more sense. If, on the other hand, you're trying to describe a bunch of items together, an array usually makes more sense. If you want to describe the attributes of each item within an array, you can create an array of structures. ... ... ... Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ phone: 202-797-5496 fax: 202-797-5444 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
Yeah, trium your damn posts :-) Mikey D put a limit on a few weeks ago. > whats this message > tw >> I keep getting a message about the number of message lines >> being too much (over 100)... is this a new CF talk list thing? [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
> Tony... why are structures a better way to go than than arrays While I'm not Tony, I wouldn't say that structures are better than arrays or vice-versa. They're different, and which is best for you at a specific time depends on what you're trying to accomplish. If you're trying to describe the attributes of a single thing, a structure usually makes more sense. If, on the other hand, you're trying to describe a bunch of items together, an array usually makes more sense. If you want to describe the attributes of each item within an array, you can create an array of structures. ... ... ... Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ phone: 202-797-5496 fax: 202-797-5444 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
meee tooo? whats this message tw -Original Message- From: Tim Laureska [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:47 AM To: CF-Talk Subject: RE: first time array I keep getting a message about the number of message lines being too much (over 100)... is this a new CF talk list thing? -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:08 AM To: CF-Talk Subject: RE: first time array tim, then there is this GREAT thing called a structure, play with this one... Hello world, my name is #me.myFirstName# #me.myLastName# and i live in #me.myCity# [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
I keep getting a message about the number of message lines being too much (over 100)... is this a new CF talk list thing? -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:08 AM To: CF-Talk Subject: RE: first time array tim, then there is this GREAT thing called a structure, play with this one... Hello world, my name is #me.myFirstName# #me.myLastName# and i live in #me.myCity# [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
heh. I new that was coming better...for me? named keys vs. numbered keys (easier to decipher) you can nest arrays in structures, so you can have an structure of arrays two off the top of my head... others...im sure there will be some chimers... tw -Original Message- From: Tim Laureska [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:35 AM To: CF-Talk Subject: RE: first time array Tony... why are structures a better way to go than than arrays -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:08 AM To: CF-Talk Subject: RE: first time array tim, then there is this GREAT thing called a structure, play with this one... Hello world, my name is #me.myFirstName# #me.myLastName# and i live in #me.myCity# -Original Message- From: Pascal Peters [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:06 AM To: CF-Talk Subject: RE: first time array A 2D array requires 2 indexes. Change the first line to > -Original Message- > From: Tim Laureska [mailto:[EMAIL PROTECTED] > Sent: dinsdag 29 juni 2004 16:09 > To: CF-Talk > Subject: RE: first time array > > Thomas... I changed what I had to this: (but now getting the > error below, which is a bit cryptic). > > > > > > > > Error Diagnostic Information > An error occurred while evaluating the _expression_: > cassettes_Array[1]=form.issue > Error near line 11, column 22. > Cannot set element of indexed object > > The element at position 1 of the object cannot be set. May be > the object is read-only. The object has elements in positions > 1 through 0. > The error is in dimension 1 of object "cassettes_Array". > > > -Original Message- > From: Thomas Chiverton [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 29, 2004 9:42 AM > To: CF-Talk > Subject: Re: first time array > > On Tuesday 29 Jun 2004 14:42 pm, Tim Laureska wrote: > > > > > > > > > > > > cassettes_Array[ArrayLen(cassettes_Array)+1][4]=#form.publication#> > > That should be > cfset cassettes_Array[1]=form.issue > cfset cassettes_Array[2]=form.title > cfset cassettes_Array[3]=form.date1 > to match your cfloop. > > cfdump var="#cassettes_Array#" is useful for figuring out > what you've just built when constructing nested structures. > -- > Tom Chiverton > Advanced ColdFusion Programmer > > Tel: +44(0)1749 834997 > email: [EMAIL PROTECTED] > BlueFinger Limited > Underwood Business Park > Wookey Hole Road, WELLS. BA5 1AF > Tel: +44 (0)1749 834900 > Fax: +44 (0)1749 834901 > web: www.bluefinger.com > Company Reg No: 4209395 Registered Office: 2 Temple Back > East, Temple Quay, BRISTOL. BS1 6EG. > *** This E-mail contains confidential information for the > addressee only. If you are not the intended recipient, please > notify us immediately. You should not use, disclose, > distribute or copy this communication if received in error. > No binding contract will result from this e-mail until such > time as a written document is signed on behalf of the > company. BlueFinger Limited cannot accept responsibility for > the completeness or accuracy of this message as it has been > transmitted over public networks.*** > > > > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
Tony... why are structures a better way to go than than arrays .. or is it just situation dependent? -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:08 AM To: CF-Talk Subject: RE: first time array tim, then there is this GREAT thing called a structure, play with this one... Hello world, my name is #me.myFirstName# #me.myLastName# and i live in #me.myCity# -Original Message- From: Pascal Peters [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:06 AM To: CF-Talk Subject: RE: first time array A 2D array requires 2 indexes. Change the first line to > -Original Message- > From: Tim Laureska [mailto:[EMAIL PROTECTED] > Sent: dinsdag 29 juni 2004 16:09 > To: CF-Talk > Subject: RE: first time array > > Thomas... I changed what I had to this: (but now getting the > error below, which is a bit cryptic). > > > > > > > > Error Diagnostic Information > An error occurred while evaluating the _expression_: > cassettes_Array[1]=form.issue > Error near line 11, column 22. > Cannot set element of indexed object > > The element at position 1 of the object cannot be set. May be > the object is read-only. The object has elements in positions > 1 through 0. > The error is in dimension 1 of object "cassettes_Array". > > > -Original Message- > From: Thomas Chiverton [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 29, 2004 9:42 AM > To: CF-Talk > Subject: Re: first time array > > On Tuesday 29 Jun 2004 14:42 pm, Tim Laureska wrote: > > > > > > > > > > > > cassettes_Array[ArrayLen(cassettes_Array)+1][4]=#form.publication#> > > That should be > cfset cassettes_Array[1]=form.issue > cfset cassettes_Array[2]=form.title > cfset cassettes_Array[3]=form.date1 > to match your cfloop. > > cfdump var="#cassettes_Array#" is useful for figuring out > what you've just built when constructing nested structures. > -- > Tom Chiverton > Advanced ColdFusion Programmer > > Tel: +44(0)1749 834997 > email: [EMAIL PROTECTED] > BlueFinger Limited > Underwood Business Park > Wookey Hole Road, WELLS. BA5 1AF > Tel: +44 (0)1749 834900 > Fax: +44 (0)1749 834901 > web: www.bluefinger.com > Company Reg No: 4209395 Registered Office: 2 Temple Back > East, Temple Quay, BRISTOL. BS1 6EG. > *** This E-mail contains confidential information for the > addressee only. If you are not the intended recipient, please > notify us immediately. You should not use, disclose, > distribute or copy this communication if received in error. > No binding contract will result from this e-mail until such > time as a written document is signed on behalf of the > company. BlueFinger Limited cannot accept responsibility for > the completeness or accuracy of this message as it has been > transmitted over public networks.*** > > > > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
Tony... why are structures a better way to go than than arrays -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:08 AM To: CF-Talk Subject: RE: first time array tim, then there is this GREAT thing called a structure, play with this one... Hello world, my name is #me.myFirstName# #me.myLastName# and i live in #me.myCity# -Original Message- From: Pascal Peters [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:06 AM To: CF-Talk Subject: RE: first time array A 2D array requires 2 indexes. Change the first line to > -Original Message- > From: Tim Laureska [mailto:[EMAIL PROTECTED] > Sent: dinsdag 29 juni 2004 16:09 > To: CF-Talk > Subject: RE: first time array > > Thomas... I changed what I had to this: (but now getting the > error below, which is a bit cryptic). > > > > > > > > Error Diagnostic Information > An error occurred while evaluating the _expression_: > cassettes_Array[1]=form.issue > Error near line 11, column 22. > Cannot set element of indexed object > > The element at position 1 of the object cannot be set. May be > the object is read-only. The object has elements in positions > 1 through 0. > The error is in dimension 1 of object "cassettes_Array". > > > -Original Message- > From: Thomas Chiverton [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 29, 2004 9:42 AM > To: CF-Talk > Subject: Re: first time array > > On Tuesday 29 Jun 2004 14:42 pm, Tim Laureska wrote: > > > > > > > > > > > > cassettes_Array[ArrayLen(cassettes_Array)+1][4]=#form.publication#> > > That should be > cfset cassettes_Array[1]=form.issue > cfset cassettes_Array[2]=form.title > cfset cassettes_Array[3]=form.date1 > to match your cfloop. > > cfdump var="#cassettes_Array#" is useful for figuring out > what you've just built when constructing nested structures. > -- > Tom Chiverton > Advanced ColdFusion Programmer > > Tel: +44(0)1749 834997 > email: [EMAIL PROTECTED] > BlueFinger Limited > Underwood Business Park > Wookey Hole Road, WELLS. BA5 1AF > Tel: +44 (0)1749 834900 > Fax: +44 (0)1749 834901 > web: www.bluefinger.com > Company Reg No: 4209395 Registered Office: 2 Temple Back > East, Temple Quay, BRISTOL. BS1 6EG. > *** This E-mail contains confidential information for the > addressee only. If you are not the intended recipient, please > notify us immediately. You should not use, disclose, > distribute or copy this communication if received in error. > No binding contract will result from this e-mail until such > time as a written document is signed on behalf of the > company. BlueFinger Limited cannot accept responsibility for > the completeness or accuracy of this message as it has been > transmitted over public networks.*** > > > > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
Pascal... your suggestion worked but I thought the # of dimensions was set in thr last parenthesis... so why isn't cassettes_Array=ArrayNew(2)> correct? -Original Message- From: Pascal Peters [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:06 AM To: CF-Talk Subject: RE: first time array A 2D array requires 2 indexes. Change the first line to > -Original Message- > From: Tim Laureska [mailto:[EMAIL PROTECTED] > Sent: dinsdag 29 juni 2004 16:09 > To: CF-Talk > Subject: RE: first time array > > Thomas... I changed what I had to this: (but now getting the > error below, which is a bit cryptic). > > > > > > > > Error Diagnostic Information > An error occurred while evaluating the _expression_: > cassettes_Array[1]=form.issue > Error near line 11, column 22. > Cannot set element of indexed object > > The element at position 1 of the object cannot be set. May be > the object is read-only. The object has elements in positions > 1 through 0. > The error is in dimension 1 of object "cassettes_Array". > > > -Original Message- > From: Thomas Chiverton [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 29, 2004 9:42 AM > To: CF-Talk > Subject: Re: first time array > > On Tuesday 29 Jun 2004 14:42 pm, Tim Laureska wrote: > > > > > > > > > > > > cassettes_Array[ArrayLen(cassettes_Array)+1][4]=#form.publication#> > > That should be > cfset cassettes_Array[1]=form.issue > cfset cassettes_Array[2]=form.title > cfset cassettes_Array[3]=form.date1 > to match your cfloop. > > cfdump var="#cassettes_Array#" is useful for figuring out > what you've just built when constructing nested structures. > -- > Tom Chiverton > Advanced ColdFusion Programmer > > Tel: +44(0)1749 834997 > email: [EMAIL PROTECTED] > BlueFinger Limited > Underwood Business Park > Wookey Hole Road, WELLS. BA5 1AF > Tel: +44 (0)1749 834900 > Fax: +44 (0)1749 834901 > web: www.bluefinger.com > Company Reg No: 4209395 Registered Office: 2 Temple Back > East, Temple Quay, BRISTOL. BS1 6EG. > *** This E-mail contains confidential information for the > addressee only. If you are not the intended recipient, please > notify us immediately. You should not use, disclose, > distribute or copy this communication if received in error. > No binding contract will result from this e-mail until such > time as a written document is signed on behalf of the > company. BlueFinger Limited cannot accept responsibility for > the completeness or accuracy of this message as it has been > transmitted over public networks.*** > > > > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
tim, then there is this GREAT thing called a structure, play with this one... Hello world, my name is #me.myFirstName# #me.myLastName# and i live in #me.myCity# -Original Message- From: Pascal Peters [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:06 AM To: CF-Talk Subject: RE: first time array A 2D array requires 2 indexes. Change the first line to > -Original Message- > From: Tim Laureska [mailto:[EMAIL PROTECTED] > Sent: dinsdag 29 juni 2004 16:09 > To: CF-Talk > Subject: RE: first time array > > Thomas... I changed what I had to this: (but now getting the > error below, which is a bit cryptic). > > > > > > > > Error Diagnostic Information > An error occurred while evaluating the _expression_: > cassettes_Array[1]=form.issue > Error near line 11, column 22. > Cannot set element of indexed object > > The element at position 1 of the object cannot be set. May be > the object is read-only. The object has elements in positions > 1 through 0. > The error is in dimension 1 of object "cassettes_Array". > > > -Original Message- > From: Thomas Chiverton [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 29, 2004 9:42 AM > To: CF-Talk > Subject: Re: first time array > > On Tuesday 29 Jun 2004 14:42 pm, Tim Laureska wrote: > > > > > > > > > > > > cassettes_Array[ArrayLen(cassettes_Array)+1][4]=#form.publication#> > > That should be > cfset cassettes_Array[1]=form.issue > cfset cassettes_Array[2]=form.title > cfset cassettes_Array[3]=form.date1 > to match your cfloop. > > cfdump var="#cassettes_Array#" is useful for figuring out > what you've just built when constructing nested structures. > -- > Tom Chiverton > Advanced ColdFusion Programmer > > Tel: +44(0)1749 834997 > email: [EMAIL PROTECTED] > BlueFinger Limited > Underwood Business Park > Wookey Hole Road, WELLS. BA5 1AF > Tel: +44 (0)1749 834900 > Fax: +44 (0)1749 834901 > web: www.bluefinger.com > Company Reg No: 4209395 Registered Office: 2 Temple Back > East, Temple Quay, BRISTOL. BS1 6EG. > *** This E-mail contains confidential information for the > addressee only. If you are not the intended recipient, please > notify us immediately. You should not use, disclose, > distribute or copy this communication if received in error. > No binding contract will result from this e-mail until such > time as a written document is signed on behalf of the > company. BlueFinger Limited cannot accept responsibility for > the completeness or accuracy of this message as it has been > transmitted over public networks.*** > > > > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: first time array
Ok. Structures can actually be a lot less to deal with. To fix the problem you just posted, change cassettes_Array=ArrayNew(2)> to -joe - Original Message - From: Tim Laureska <[EMAIL PROTECTED]> Date: Tue, 29 Jun 2004 10:10:12 -0400 Subject: RE: first time array To: CF-Talk <[EMAIL PROTECTED]> Thanks Joe... I'm new to arrays and structures so kinda feeling my way here... I'd like to stick with an array for now so I can learn how they work, but not having much success yet -Original Message- From: Joe Rinehart [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:00 AM To: CF-Talk Subject: Re: first time array Hi Tim, I'm not sure why you're using a two-dimensional array here - also, this looks like a place where a structure could simplify your life greatly. Instead of having to remember "1 = issue, 2 = title, etc.," with a structure, you can just name things what they are. Maybe try something like this: #cassette_Structure.issue# #cassette_Structure.title# #cassette_Structure.date1# #cassette_Structure.publication# #i#: #cassette_Structure[i]# You can expand on this at will - if you need to keep track of multiple cassettes, you could create a cassette_Array where each element is, in turn, a cassette_Structure like the one created above. -Joe - Original Message - From: Tim Laureska <[EMAIL PROTECTED]> Date: Tue, 29 Jun 2004 09:42:21 -0400 Subject: first time array To: CF-Talk <[EMAIL PROTECTED]> This is the first time I've tried to use an array and I have a very basic question... how do you get the array contents to display !? this must be something silly I'm not doing I have one form template that sends 4 form field entries to a processing template. The processing template looks as follows (I'm not exactly sure the cfsets are right but it doesn't throw an error but nor does it output anything either): cassettes_Array[ArrayLen(cassettes_Array)+1][4]=#form.publication#> #cassettes_Array[i]# TIA Tim [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
tim, start small, start with a 1 dim array. Hello world, my name is #myNameArray[1]# #myNameArray[2]# -Original Message- From: Tim Laureska [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:10 AM To: CF-Talk Subject: RE: first time array Thanks Joe... I'm new to arrays and structures so kinda feeling my way here... I'd like to stick with an array for now so I can learn how they work, but not having much success yet -Original Message- From: Joe Rinehart [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:00 AM To: CF-Talk Subject: Re: first time array Hi Tim, I'm not sure why you're using a two-dimensional array here - also, this looks like a place where a structure could simplify your life greatly. Instead of having to remember "1 = issue, 2 = title, etc.," with a structure, you can just name things what they are. Maybe try something like this: #cassette_Structure.issue# #cassette_Structure.title# #cassette_Structure.date1# #cassette_Structure.publication# #i#: #cassette_Structure[i]# You can expand on this at will - if you need to keep track of multiple cassettes, you could create a cassette_Array where each element is, in turn, a cassette_Structure like the one created above. -Joe - Original Message - From: Tim Laureska <[EMAIL PROTECTED]> Date: Tue, 29 Jun 2004 09:42:21 -0400 Subject: first time array To: CF-Talk <[EMAIL PROTECTED]> This is the first time I've tried to use an array and I have a very basic question... how do you get the array contents to display !? this must be something silly I'm not doing I have one form template that sends 4 form field entries to a processing template. The processing template looks as follows (I'm not exactly sure the cfsets are right but it doesn't throw an error but nor does it output anything either): cassettes_Array[ArrayLen(cassettes_Array)+1][4]=#form.publication#> #cassettes_Array[i]# TIA Tim [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
A 2D array requires 2 indexes. Change the first line to > -Original Message- > From: Tim Laureska [mailto:[EMAIL PROTECTED] > Sent: dinsdag 29 juni 2004 16:09 > To: CF-Talk > Subject: RE: first time array > > Thomas... I changed what I had to this: (but now getting the > error below, which is a bit cryptic). > > > > > > > > Error Diagnostic Information > An error occurred while evaluating the _expression_: > cassettes_Array[1]=form.issue > Error near line 11, column 22. > Cannot set element of indexed object > > The element at position 1 of the object cannot be set. May be > the object is read-only. The object has elements in positions > 1 through 0. > The error is in dimension 1 of object "cassettes_Array". > > > -Original Message- > From: Thomas Chiverton [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 29, 2004 9:42 AM > To: CF-Talk > Subject: Re: first time array > > On Tuesday 29 Jun 2004 14:42 pm, Tim Laureska wrote: > > > > > > > > > > > > cassettes_Array[ArrayLen(cassettes_Array)+1][4]=#form.publication#> > > That should be > cfset cassettes_Array[1]=form.issue > cfset cassettes_Array[2]=form.title > cfset cassettes_Array[3]=form.date1 > to match your cfloop. > > cfdump var="#cassettes_Array#" is useful for figuring out > what you've just built when constructing nested structures. > -- > Tom Chiverton > Advanced ColdFusion Programmer > > Tel: +44(0)1749 834997 > email: [EMAIL PROTECTED] > BlueFinger Limited > Underwood Business Park > Wookey Hole Road, WELLS. BA5 1AF > Tel: +44 (0)1749 834900 > Fax: +44 (0)1749 834901 > web: www.bluefinger.com > Company Reg No: 4209395 Registered Office: 2 Temple Back > East, Temple Quay, BRISTOL. BS1 6EG. > *** This E-mail contains confidential information for the > addressee only. If you are not the intended recipient, please > notify us immediately. You should not use, disclose, > distribute or copy this communication if received in error. > No binding contract will result from this e-mail until such > time as a written document is signed on behalf of the > company. BlueFinger Limited cannot accept responsibility for > the completeness or accuracy of this message as it has been > transmitted over public networks.*** > > > > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
Thanks Joe... I'm new to arrays and structures so kinda feeling my way here... I'd like to stick with an array for now so I can learn how they work, but not having much success yet -Original Message- From: Joe Rinehart [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:00 AM To: CF-Talk Subject: Re: first time array Hi Tim, I'm not sure why you're using a two-dimensional array here - also, this looks like a place where a structure could simplify your life greatly. Instead of having to remember "1 = issue, 2 = title, etc.," with a structure, you can just name things what they are. Maybe try something like this: #cassette_Structure.issue# #cassette_Structure.title# #cassette_Structure.date1# #cassette_Structure.publication# #i#: #cassette_Structure[i]# You can expand on this at will - if you need to keep track of multiple cassettes, you could create a cassette_Array where each element is, in turn, a cassette_Structure like the one created above. -Joe - Original Message - From: Tim Laureska <[EMAIL PROTECTED]> Date: Tue, 29 Jun 2004 09:42:21 -0400 Subject: first time array To: CF-Talk <[EMAIL PROTECTED]> This is the first time I've tried to use an array and I have a very basic question... how do you get the array contents to display !? this must be something silly I'm not doing I have one form template that sends 4 form field entries to a processing template. The processing template looks as follows (I'm not exactly sure the cfsets are right but it doesn't throw an error but nor does it output anything either): cassettes_Array[ArrayLen(cassettes_Array)+1][4]=#form.publication#> #cassettes_Array[i]# TIA Tim [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
Thomas... I changed what I had to this: (but now getting the error below, which is a bit cryptic). Error Diagnostic Information An error occurred while evaluating the _expression_: cassettes_Array[1]=form.issue Error near line 11, column 22. Cannot set element of indexed object The element at position 1 of the object cannot be set. May be the object is read-only. The object has elements in positions 1 through 0. The error is in dimension 1 of object "cassettes_Array". -Original Message- From: Thomas Chiverton [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 9:42 AM To: CF-Talk Subject: Re: first time array On Tuesday 29 Jun 2004 14:42 pm, Tim Laureska wrote: > > > > > > cassettes_Array[ArrayLen(cassettes_Array)+1][4]=#form.publication#> That should be cfset cassettes_Array[1]=form.issue cfset cassettes_Array[2]=form.title cfset cassettes_Array[3]=form.date1 to match your cfloop. cfdump var="#cassettes_Array#" is useful for figuring out what you've just built when constructing nested structures. -- Tom Chiverton Advanced ColdFusion Programmer Tel: +44(0)1749 834997 email: [EMAIL PROTECTED] BlueFinger Limited Underwood Business Park Wookey Hole Road, WELLS. BA5 1AF Tel: +44 (0)1749 834900 Fax: +44 (0)1749 834901 web: www.bluefinger.com Company Reg No: 4209395 Registered Office: 2 Temple Back East, Temple Quay, BRISTOL. BS1 6EG. *** This E-mail contains confidential information for the addressee only. If you are not the intended recipient, please notify us immediately. You should not use, disclose, distribute or copy this communication if received in error. No binding contract will result from this e-mail until such time as a written document is signed on behalf of the company. BlueFinger Limited cannot accept responsibility for the completeness or accuracy of this message as it has been transmitted over public networks.*** [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: first time array
Hi Tim, I'm not sure why you're using a two-dimensional array here - also, this looks like a place where a structure could simplify your life greatly. Instead of having to remember "1 = issue, 2 = title, etc.," with a structure, you can just name things what they are. Maybe try something like this: #cassette_Structure.issue# #cassette_Structure.title# #cassette_Structure.date1# #cassette_Structure.publication# #i#: #cassette_Structure[i]# You can expand on this at will - if you need to keep track of multiple cassettes, you could create a cassette_Array where each element is, in turn, a cassette_Structure like the one created above. -Joe - Original Message - From: Tim Laureska <[EMAIL PROTECTED]> Date: Tue, 29 Jun 2004 09:42:21 -0400 Subject: first time array To: CF-Talk <[EMAIL PROTECTED]> This is the first time I've tried to use an array and I have a very basic question... how do you get the array contents to display !? this must be something silly I'm not doing I have one form template that sends 4 form field entries to a processing template. The processing template looks as follows (I'm not exactly sure the cfsets are right but it doesn't throw an error but nor does it output anything either): cassettes_Array[ArrayLen(cassettes_Array)+1][4]=#form.publication#> #cassettes_Array[i]# TIA Tim [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: first time array
cassettes_Array[ArrayLen(cassettes_Array)][4]=#form.publication#> Record #i# #cassettes_Array[i][j]# > -Original Message- > From: Tim Laureska [mailto:[EMAIL PROTECTED] > Sent: dinsdag 29 juni 2004 15:42 > To: CF-Talk > Subject: first time array > > This is the first time I've tried to use an array and I have > a very basic question... how do you get the array contents to > display !? this must be something silly I'm not doing > > I have one form template that sends 4 form field entries to a > processing template. The processing template looks as > follows (I'm not exactly sure the cfsets are right but it > doesn't throw an error but nor does it output anything either): > > > > > > > cassettes_Array[ArrayLen(cassettes_Array)+1][4]=#form.publication#> > > > > #cassettes_Array[i]# > > TIA > Tim > > > > > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: first time array
On Tuesday 29 Jun 2004 14:42 pm, Tim Laureska wrote: > > > > > > cassettes_Array[ArrayLen(cassettes_Array)+1][4]=#form.publication#> That should be cfset cassettes_Array[1]=form.issue cfset cassettes_Array[2]=form.title cfset cassettes_Array[3]=form.date1 to match your cfloop. cfdump var="#cassettes_Array#" is useful for figuring out what you've just built when constructing nested structures. -- Tom Chiverton Advanced ColdFusion Programmer Tel: +44(0)1749 834997 email: [EMAIL PROTECTED] BlueFinger Limited Underwood Business Park Wookey Hole Road, WELLS. BA5 1AF Tel: +44 (0)1749 834900 Fax: +44 (0)1749 834901 web: www.bluefinger.com Company Reg No: 4209395 Registered Office: 2 Temple Back East, Temple Quay, BRISTOL. BS1 6EG. *** This E-mail contains confidential information for the addressee only. If you are not the intended recipient, please notify us immediately. You should not use, disclose, distribute or copy this communication if received in error. No binding contract will result from this e-mail until such time as a written document is signed on behalf of the company. BlueFinger Limited cannot accept responsibility for the completeness or accuracy of this message as it has been transmitted over public networks.*** [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
first time array
This is the first time I've tried to use an array and I have a very basic question... how do you get the array contents to display !? this must be something silly I'm not doing I have one form template that sends 4 form field entries to a processing template. The processing template looks as follows (I'm not exactly sure the cfsets are right but it doesn't throw an error but nor does it output anything either): cassettes_Array[ArrayLen(cassettes_Array)+1][4]=#form.publication#> #cassettes_Array[i]# TIA Tim [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]