home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.tcl
- Path: sparky!uunet!uunet.ca!choreo!root
- From: root@choreo.ca (Superuser)
- Subject: problem with lists
- Organization: Choreo Systems, Ottawa Canada
- Date: Fri, 18 Dec 1992 21:30:13 GMT
- Message-ID: <1992Dec18.213013.3883@choreo.ca>
- Lines: 33
-
- Hey folks!
-
- I am working on this app, and I'm having a little trouble with the way that
- lists are created.
-
- This is my code :
-
- The idea is that I will read my input, which is two fields, colon selimited,
- and stuff each field into a spearate list, which will be used later.
-
- set end [ eof $fd ]
- set nameList ""
- set fileList ""
- while { $end == 0 } {
- set record [ gets $fd ]
- set reclist [ split $record : ]
- puts stdout "list = $reclist"
- set file [lindex $reclist 0]
- puts stdout "file = $file"
- set name [lindex $reclist 1]
- puts stdout "name = $name"
- puts stdout "all = $nameList"
- set $nameList [ list $nameList $name ]
- list $fileList $file
- .label_and_buttons.list insert end $name
- set end [ eof $fd ]
- }
-
- The problem is that after frigging around various incantations, including
- using lappend, I'm lost. How do I get my lists to contain what I want here?
-
- Thanks!
-
-