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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Build an array from a table or query

Status
Not open for further replies.

crimmelcp

Programmer
Oct 13, 2004
31
0
0
US
The code below builds an array from a list that is keyed in.
How can I convert this to use a table and a query.
Charlie Crimmel

Code:
ItemList = new Array() // Navigator 3.0 array object constructor
ItemList[0] = new CF_ChangeItem("451","50","ELGF","20.05","30.08","40.10","40.00","50.00","60.00","40.00","50.00","60.00")
ItemList[1] = new CF_ChangeItem("452","133","ELF","20.05","30.08","40.10","40.00","50.00","60.00","40.00","50.00","60.00")
ItemList[2] = new CF_ChangeItem("453","298","ELJ","20.05","30.08","40.10","40.00","50.00","60.00","40.00","50.00","60.00")
ItemList[3] = new CF_ChangeItem("454","467","ELA-60","20.05","30.08","40.10","40.00","50.00","60.00","40.00","50.00","60.00")
ItemList[4] = new CF_ChangeItem("455","422","ELA-70","20.05","30.08","40.10","40.00","50.00","60.00","40.00","50.00","60.00")
 
this is javascript code it looks like? with no ; after the lines am i correct.

you'd do something like this
psudo-code not tested may need to tweek
Code:
ItemList = new Array()
<cfoutput query = "yourQuery">
ItemList[#yourQuery.currentRow#] = new CF_ChangeItem ("#yourQuery.columnName1#", "#yourQuery.columnName1#", "#yourQuery.columnName1#", "#yourQuery.columnName1#", ... ...);
</cfoutput>

Beware of programmers who carry screwdrivers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top