[REBOL] Re: hard coded somewhere?
From: agem:crosswinds at: 29-May-2001 6:25
>>>>>>>>>>>>>>>>>> Ursprüngliche Nachricht <<<<<<<<<<<<<<<<<<
Am 29.05.01, 01:19:07, schrieb "GS Jones" <[gjones05--mail--orion--org]> zum
Thema [REBOL] Re: hard coded somewhere?:
> From: "Ammon Cooke"
> > Hi,
> >
> > Using the foreach line example from Core.pdf I get this:
> >
> > jobfile: request-file/filter "*.jbs" /file "jobs.jbs"
> > file-jobs: read/lines file jobfile
> > foreach line file-jobs [
> > append jobs/data copy line
> > ]
> > fix-slider jobs
> > show jobs
> >
> > it always gives me the same data in 'jobs' (which
> > happens to be a text-list) no matter what file I tell
> > it to open. Why??
> >
> > Thanks!!
> > Ammon
> Depending the sequence of your code (I don't believe all of it was in
> your message), you will want to clear the data store for the list
before
> reusing it. The simplist course may be to:
> ...
> jobs/data: copy [] ;add this line to clear this buffer
> foreach line file-jobs [
> append jobs/data copy line
> ]
> Hopefully that will fix the problem. :-)
I think it will continue to fail :)
my previous post showed, that request-file returns a block.
But then this line should throw an error, not read data..:
> > file-jobs: read/lines file jobfile
hehe.
> > file-jobs: read/lines jobfile
this would throw the error ;-)
Hi Ammon, you are allways reading the same 'FILE,
not the one you request-file'd.
Rebol reads it
(file-jobs: read/lines file) jobfile
and throws jobfile away.
Congratulation! You caught me! ;-)
> --Scott Jones
-Volker