[Coco] results on INPUT vs. READ for disk files in BASIC09
asa.rand at gmail.com
Tue Jun 5 09:46:09 EDT 2018
You need to compare what you just wrote to what I said. I did not include
the portion of the READ statement that reads a DATA statement since that
was not part of the discussion. The part that reads an askii record is the
part I was discussing. And it will read an entire file into a single string
if the string is long enough. You can also use get to get the entire file
in one chunk, rather than reading the file one bite at a time. But I do
believe I remember being able to read a file and it will on one read fill
up an entire string if that's what you're reading into. I will have to run
some tests on that to determine if my memory is correct or not.
On Tue, Jun 5, 2018, 1:21 AM James Jones <jejones3141 at gmail.com> wrote:
> That seems inconsistent with the BASIC09 manual (I got the printed one out
> this time), which says
> - [READ] reads either an ASCII record from a sequential file or device,
> or an item from a DATA statement
> - Each input record is terminated by a carriage return character.
> On Mon, Jun 4, 2018 at 9:22 PM, Wayne Campbell <asa.rand at gmail.com> wrote:
> > Don't forget that INPUT looks for a carraige return character to
> > input. READ does not do this and can read an entire file into a string,
> > provided the file is shorter than the string variable.
> > On Mon, Jun 4, 2018, 2:11 PM James Jones <jejones3141 at gmail.com> wrote:
> > > INPUT ignores the prompt if it is given a path connected to a disk file
> > not
> > > opened for update.
> > >
> > > READ, if given a path, will do just as well without needing a prompt.
> > >
> > > --
> > > Coco mailing list
> > > Coco at maltedmedia.com
> > > https://pairlist5.pair.net/mailman/listinfo/coco
> > >
> > --
> > Coco mailing list
> > Coco at maltedmedia.com
> > https://pairlist5.pair.net/mailman/listinfo/coco
> Coco mailing list
> Coco at maltedmedia.com
More information about the Coco