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


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

Re: Arrays in BASIC

From Steve Drain <steve@kappa.me.uk>
Newsgroups comp.sys.acorn.programmer
Subject Re: Arrays in BASIC
Date 2022-01-03 09:46 +0000
Organization Aioe.org NNTP Server
Message-ID <squgo7$nvs$1@gioia.aioe.org> (permalink)
References <3261a6a459.Paul@outlook.com> <65baa8a459.harriet@bazleyfamily.co.uk> <59a4ae6e72News03@avisoft.f9.co.uk> <d014b2a459.harriet@bazleyfamily.co.uk>

Show all headers | View raw


On 02/01/2022 22:43, Harriet Bazley wrote:
> On 2 Jan 2022 as I do recall,
>            Martin  wrote:
> 
>> You should download the BASIC manual from
>> https://www.riscosopen.org/content/downloads/common
>> which is *much* more up to date!
>>
> There's certainly stuff in there about arrays that I had no idea about -
> I don't know if that's because it's genuinely new since 1987, or because
> I never attempted whole-array operations....

Whole array operations have been there from the first BASIC V. I am 
particularly fond of array multiplication, the . operator. This makes 
vector transformations a doddle. It is a pity there are not more matrix 
operations.


> 10 DIM A(2,2)
> 
> 60 A() += n%*n%
> 
> equates to "square the variable n% and increase each and every element
> in the array A() by the result of that calculation"

Just a warning that the apparently similar:

  60 A() = n%*n%

has to be:

  60 A() = (n%*n%)

And do not forget:

  A() = 1,2,3,4,5,6

to fill an array.

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


Thread

Arrays in BASIC Paul Stewart <narrowboat-paul@outlook.com> - 2022-01-02 20:36 +0000
  Re: Arrays in BASIC Harriet Bazley <harriet@bazleyfamily.co.uk> - 2022-01-02 21:01 +0000
    Re: Arrays in BASIC Paul Stewart <narrowboat-paul@outlook.com> - 2022-01-02 21:56 +0000
      Re: Arrays in BASIC Paul Stewart <narrowboat-paul@outlook.com> - 2022-01-02 22:18 +0000
    Re: Arrays in BASIC Martin <News03@avisoft.f9.co.uk> - 2022-01-02 22:04 +0000
      Re: Arrays in BASIC Harriet Bazley <harriet@bazleyfamily.co.uk> - 2022-01-02 22:43 +0000
        Re: Arrays in BASIC Martin <News03@avisoft.f9.co.uk> - 2022-01-02 23:18 +0000
        Re: Arrays in BASIC Steve Drain <steve@kappa.me.uk> - 2022-01-03 09:46 +0000

csiph-web