Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #5682

Re: Traversing a directory in BASIC...

From Steve Fryatt <news@stevefryatt.org.uk>
Newsgroups comp.sys.acorn.programmer
Subject Re: Traversing a directory in BASIC...
Date 2019-01-21 23:59 +0000
Organization Aioe.org NNTP Server
Message-ID <mpro.plphal02u95ej01pb.news@stevefryatt.org.uk> (permalink)
References <5551f8d2-bbd0-4d15-aa64-bc799be24414@googlegroups.com> <mpro.plpduj01xvpnf01pb.news@stevefryatt.org.uk> <1736875c-babb-4d19-88f7-6f6863d5da8d@googlegroups.com>

Show all headers | View raw


On 21 Jan, usenet@garethlock.com wrote in message
    <1736875c-babb-4d19-88f7-6f6863d5da8d@googlegroups.com>:

> That's alright if you know the value of objects_to_read%. I seem to be
> coming a cropper when passing a nonsense number here when trying to read
> all the objects in the current directory whilst not knowing how many this
> is...

objects_to_read% is a maximum. The call returns the number of items read in
the variable that I called read%, and that's what the IF statement was for:
you check how many items have come back, and process them (using a FOR loop
or whatever).

Rememeber that the call can return zero items even though there are more to
come. You muct check the number of items returned each time and skip if
there are none, but continue polling until next% is returned as -1.

-- 
Steve Fryatt - Leeds, England

http://www.stevefryatt.org.uk/

Back to comp.sys.acorn.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Traversing a directory in BASIC... usenet@garethlock.com - 2019-01-21 13:48 -0800
  Re: Traversing a directory in BASIC... Gerald Holdsworth <nospam@hollypops.co.uk> - 2019-01-21 22:18 +0000
  Re: Traversing a directory in BASIC... Steve Fryatt <news@stevefryatt.org.uk> - 2019-01-21 22:44 +0000
    Re: Traversing a directory in BASIC... usenet@garethlock.com - 2019-01-21 15:02 -0800
      Re: Traversing a directory in BASIC... Steve Fryatt <news@stevefryatt.org.uk> - 2019-01-21 23:59 +0000
        Re: Traversing a directory in BASIC... usenet@garethlock.com - 2019-01-21 18:12 -0800
          Re: Traversing a directory in BASIC... Matthew Phillips <spam2011m@yahoo.co.uk> - 2019-01-22 08:14 +0000
  Re: Traversing a directory in BASIC... Martin <News03@avisoft.f9.co.uk> - 2019-01-21 23:04 +0000
    Re: Traversing a directory in BASIC... usenet@garethlock.com - 2019-01-21 15:53 -0800
    Re: Traversing a directory in BASIC... Alan Adams <alan@adamshome.org.uk> - 2019-01-22 12:26 +0000
      Re: Traversing a directory in BASIC... Martin <News03@avisoft.f9.co.uk> - 2019-01-22 16:30 +0000
        Re: Traversing a directory in BASIC... jgh@mdfs.net - 2019-01-23 05:26 -0800
          Re: Traversing a directory in BASIC... Alan Adams <alan@adamshome.org.uk> - 2019-01-23 15:01 +0000
          Re: Traversing a directory in BASIC... David Higton <dave@davehigton.me.uk> - 2019-01-24 14:35 +0000
  Re: Traversing a directory in BASIC... Richard Porter <dontusethis@address.uk.invalid> - 2019-01-27 23:33 +0000

csiph-web