|
|
Question : Structs, Arrays and CF script
|
|
Two separate questions, but I'm sure someone will have quick answer to both.
I'm auto generating a form tool. For each form I need a name, caption, value, fieldtype and various other elements.
I want to loop through a list called formnamelist (e.g. "firstname,lastname,company,add1,add2")
Rather than having a list for each element (which means I must define at least one restrictred character which can't be in the list - whether it's a , or a |), I'd like to be able to programatically access the data for everything in
FieldFirstName.Value = "Peter" FieldLastName.Caption = "Last Name" or something similar (e.g. Field[FirstName][Caption]) Want to key off of the NAME of the field rather than just a regular numeric array.
Any thoughts?
Also an associated question (after looking at the cfstruct help docs) - where and why would I use a cfscript and what are the processing time implications.
Any good ideas appreciated!
Thanks, Peter
|
Answer : Structs, Arrays and CF script
|
|
well you have to have some delimeter to have the list to begin with - so you have to decide what will be the delimeter. Comma is a good choice because you don't want to have a field with a comma in the name.
cfscript processes faster in huge cases, but in most cases there is not a noticable difference in processing time.
|
|
|
|
|