1. Kanarie List Issue
- Posted by cklester <cklester at yahoo.com> Aug 09, 2005
- 507 views
- Last edited Aug 10, 2005
Tommy, I apparently don't know how to use lists... Check this out and let me know what I'm doing wrong... please! :) In my program: if length(dblist) > 0 then i = addListItem(data,"databases") for t=1 to length(dblist) do setValue(i,"dbname",dblist[t][D_NAME]) end for end if In my KNR template: {db_count=0:} {:db_count=:}<p>Open Database ({db_count})</p> <ul id="navlist"> {databases:}<li><a href="?dbopen={dbname}">{dbname}</a></li>{:databases} </ul> {* list databases *} {:db_count} -=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/
2. Re: Kanarie List Issue
- Posted by Tommy Carlier <tommy.carlier at telenet.be> Aug 10, 2005
- 471 views
cklester wrote: > Tommy, I apparently don't know how to use lists... Check this out and let me > know what I'm doing wrong... please! :) > > In my program: > > if length(dblist) > 0 then > i = addListItem(data,"databases") > for t=1 to length(dblist) do > setValue(i,"dbname",dblist[t][D_NAME]) > end for > end if > > In my KNR template: > > {db_count=0:} > {:db_count=:}<p>Open Database ({db_count})</p> > <ul id="navlist"> > {databases:}<li><a href="?dbopen={dbname}">{dbname}</a></li>{:databases} > </ul> > {* list databases *} > {:db_count} OK, I see what's happening. You only add 1 list-item, and then you set the dbname-field for that item to different values. The 'addListItem' should be inside the for-loop: for each 'database', you add an item to the list. Like this:
if length(dblist) > 0 then for t = 1 to length(dblist) do i = addListItem(data, "databases") setValue(i, "dbname", dblist[t][D_NAME]) end for end if
-- The Internet combines the excitement of typing with the reliability of anonymous hearsay. tommy online: http://users.telenet.be/tommycarlier tommy.blog: http://tommycarlier.blogspot.com
3. Re: Kanarie List Issue
- Posted by cklester <cklester at yahoo.com> Aug 10, 2005
- 469 views
Tommy Carlier wrote: > > OK, I see what's happening. You only add 1 list-item, and then you set the > dbname-field for that item to different values. The 'addListItem' should be > inside the for-loop: for each 'database', you add an item to the list. Thanks Tommy. I got a little confused with your row/cell example. heheh. -=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/