home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.tcl
- Path: sparky!uunet!ukma!darwin.sura.net!zaphod.mps.ohio-state.edu!uunet.ca!unilabs!chare
- From: chare@unilabs.uucp (Chris Hare)
- Subject: new user questions
- Message-ID: <1992Nov10.133434.26583@unilabs.uucp>
- Organization: UniLabs Research Group
- Date: Tue, 10 Nov 1992 13:34:34 GMT
- Lines: 37
-
- Tcl6.4
- Tk2.3
- SCO UNIX 3.2v4
-
- Well, I'm missing something somewhere. Consider this code extract:
-
- catch { set fd [ open "$CategoryList" "r" ] } ok
- puts stdout "fd = $fd"
- set end { eof fd }
- puts stdout "eof = $end"
- while { $end == 0 } {
- set record { gets $fd }
- puts stdout "have $record"
- #
- # define the list
- #
- .left.list insert end $record
- set end { eof $fd }
- puts stdout "eof = $end"
- }
-
- What I want to acheive is to fill a list box with the contents of a file.
- The open and catch work OK (although I want to add code to test for failure
- and show a dialog box ), but the problem specifically is with the call to
- eof. The puts after the call to eof says the variable end contains the
- text "eof fd". How do I do this properly?
-
- In addition, is there a tcl command like split it perl? I have in anotehr
- file which will be processed the text for the list box, and then a keyword
- which specifies the name of the file which is to be opened. This
- information separated by colons.
-
- Thanks!
- --
- ???? --- It Always works for me! ---
- Chris Hare, UNIX Scientist Preferred : chare@unilabs.org
- Just a mild-mannered consultant by day ....
-