Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mixing Arrays and Structures

Status
Not open for further replies.

riluve

Technical User
Mar 11, 2005
78
US
I may be mistaken, but currently I can only make arrays work when assigned to discrete numbers (e.g. 1,2,3) and structures only with a defined label (e.g. key1, key2, key3).

If this assessment is correct I would like to make an “array” of “structures” which I can’t seem to get right either.

Here is my point/objective – to have a list of items that basically then would have descriptors. Ergo, I could loop though the list using discrete numbers but then finally on the final “level” I can use meaningful labels.

Example:

List.1.Title
List.1.Size
List.1.Other
List.2.Title
List.2.Size
List.2.Other

Maybe there's a better solution that does the same thing as this doesn't seem possible.
 
yeah, but a little different...I have used structures of arrays. Works great for shoping cart items, etc..


strThisOne=StructNew();
strThisOne.title=ArrayNew(1);
strThisOne.other=ArrayNew(1);


Then to poulate it from a query or loop, whwtver, you need to get the position of the next item...
ThisItem=ArrayLen(strFeature.title) +1;
strThisOne.title[ThisItem]=aquery.title;
strThisOne.other[ThisItem]=aquery.other;


Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top