Groups | Search | Server Info | Login | Register


Groups > comp.lang.logo > #103

Trouble reading from file

X-Received by 2002:aed:3bab:: with SMTP id r40mr1392602qte.232.1572306768663; Mon, 28 Oct 2019 16:52:48 -0700 (PDT)
X-Received by 2002:aca:dad6:: with SMTP id r205mr1574689oig.6.1572306768370; Mon, 28 Oct 2019 16:52:48 -0700 (PDT)
Path csiph.com!xmission!news.alt.net!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!j16no9912834qtl.0!news-out.google.com!x9ni397qti.1!nntp.google.com!j16no9912827qtl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.logo
Date Mon, 28 Oct 2019 16:52:48 -0700 (PDT)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=72.66.84.73; posting-account=QUliIgoAAAApv1n-rI8DTnWQt5fc1rnG
NNTP-Posting-Host 72.66.84.73
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <7a69c7e7-04f6-40d8-a93a-e606190c4e92@googlegroups.com> (permalink)
Subject Trouble reading from file
From NewLogoUser <1001firstlast@gmail.com>
Injection-Date Mon, 28 Oct 2019 23:52:48 +0000
Content-Type text/plain; charset="UTF-8"
Lines 29
Xref csiph.com comp.lang.logo:103

Show key headers only | View raw


I'm working my way through Computer Science Logo Style using UCB Logo 6.0 on Win10

One of the examples is the extract procedure, on this page:
https://people.eecs.berkeley.edu/~bh/v2ch1/files.html

My problem is that it will only read one line from the file.  I made the sample file using Notepad.exe with 2 entries separated by a hard return (the ENTER) key.

Here's the procedure and the sample case:

to extract :word :file
openread :file
setread :file
extract1 :word
setread []
close :file
end

to extract1 :word
local "line
if eofp [stop]
make "line readlist
if memberp :word :line [print :line]
extract1 :word
end

? extract "brian "phonelist
Brian Harvey 555-2368
Brian Silverman 555-5274

My sample file had the 2 Brian lines but only the first one is retrieved.  Any ideas what's going on?  - Thanks

Back to comp.lang.logo | Previous | NextNext in thread | Find similar


Thread

Trouble reading from file NewLogoUser <1001firstlast@gmail.com> - 2019-10-28 16:52 -0700
  Re: Trouble reading from file Alexey Slyusar <aleksey.slyusar@gmail.com> - 2019-11-05 01:56 -0800

csiph-web