Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Air pollution is really making us pay through the nose.


devel / comp.sys.acorn.programmer / Arrays in BASIC

SubjectAuthor
* Arrays in BASICPaul Stewart
`* Re: Arrays in BASICHarriet Bazley
 +* Re: Arrays in BASICPaul Stewart
 |`- Re: Arrays in BASICPaul Stewart
 `* Re: Arrays in BASICMartin
  `* Re: Arrays in BASICHarriet Bazley
   +- Re: Arrays in BASICMartin
   `- Re: Arrays in BASICSteve Drain

1
Arrays in BASIC

<3261a6a459.Paul@outlook.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=75&group=comp.sys.acorn.programmer#75

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!aioe.org!U/KX8ba/OMuTXW5s0P7Tsg.user.46.165.242.75.POSTED!not-for-mail
From: narrowbo...@outlook.com (Paul Stewart)
Newsgroups: comp.sys.acorn.programmer
Subject: Arrays in BASIC
Date: Sun, 02 Jan 2022 20:36:06 GMT
Organization: Aioe.org NNTP Server
Lines: 22
Message-ID: <3261a6a459.Paul@outlook.com>
Injection-Info: gioia.aioe.org; logging-data="29604"; posting-host="U/KX8ba/OMuTXW5s0P7Tsg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Messenger-Pro/8.05wpb1 (RemoteNB/3.13) (RISC-OS/4.42)
X-Notice: Filtered by postfilter v. 0.9.2
X-Editor: EmailEdit 2.04
 by: Paul Stewart - Sun, 2 Jan 2022 20:36 UTC

Hi guys,

Need to pick you brains on Arrays.

Looking at Arrays in the Archimedies User Guide (vintage July 1987), I
have come to the understanding that it is possible to declare an array
local to a function or procedure. Having tried to do this, I keep getting
Syntax Error.

I am trying using: LOCAL DIM a$(1,1)

Also tried different permutations, but all come back with Syntax error.

Am I barking up the wrong tree here or just completely misunderstanding
the examples provided?

Any advice examples you can give, much appreciated.

--
Paul Stewart
Sent from A9home running RISC OS 4.42

Re: Arrays in BASIC

<65baa8a459.harriet@bazleyfamily.co.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=76&group=comp.sys.acorn.programmer#76

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: harr...@bazleyfamily.co.uk (Harriet Bazley)
Newsgroups: comp.sys.acorn.programmer
Subject: Re: Arrays in BASIC
Date: Sun, 02 Jan 2022 21:01:45 GMT
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <65baa8a459.harriet@bazleyfamily.co.uk>
References: <3261a6a459.Paul@outlook.com>
Injection-Info: reader02.eternal-september.org; posting-host="047d3f776340ab27322e3cb2ada5d8c7";
logging-data="8055"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19tCqsB7Rwxw+b/yTPRHYd4aNTHPq4DEMQ="
User-Agent: Messenger-Pro/8.04 (MsgServe/8.04) (RISC-OS/5.27) NewsHound/v1.53-32 RC1
Cancel-Lock: sha1:mDOpYblkM7jvfDffVGJdnGMnpdA=
X-Clacks-Overhead: GNU Terry Pratchett
 by: Harriet Bazley - Sun, 2 Jan 2022 21:01 UTC

On 2 Jan 2022 as I do recall,
Paul Stewart wrote:

> Hi guys,
>
> Need to pick you brains on Arrays.
>
> Looking at Arrays in the Archimedies User Guide (vintage July 1987), I
> have come to the understanding that it is possible to declare an array
> local to a function or procedure. Having tried to do this, I keep getting
> Syntax Error.
>
> I am trying using: LOCAL DIM a$(1,1)
>
> Also tried different permutations, but all come back with Syntax error.
>
> Am I barking up the wrong tree here or just completely misunderstanding
> the examples provided?
>
> Any advice examples you can give, much appreciated.

>L.
10 PROCarray
16 PRINT D$(1)
17 END

20 DEF PROCarray
30 LOCAL D$()
40 DIM D$(7)
50 D$(1)="hat"
55 PRINT "array", D$(1)
60 ENDPROC

>RUN
array hat
Undimensioned array at line 16

--
Harriet Bazley == Loyaulte me lie ==

Nothing is foolproof - to a sufficiently talented fool

Re: Arrays in BASIC

<12c0ada459.Paul@outlook.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=77&group=comp.sys.acorn.programmer#77

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!aioe.org!U/KX8ba/OMuTXW5s0P7Tsg.user.46.165.242.75.POSTED!not-for-mail
From: narrowbo...@outlook.com (Paul Stewart)
Newsgroups: comp.sys.acorn.programmer
Subject: Re: Arrays in BASIC
Date: Sun, 02 Jan 2022 21:56:36 GMT
Organization: Aioe.org NNTP Server
Lines: 34
Message-ID: <12c0ada459.Paul@outlook.com>
References: <3261a6a459.Paul@outlook.com> <65baa8a459.harriet@bazleyfamily.co.uk>
Injection-Info: gioia.aioe.org; logging-data="27016"; posting-host="U/KX8ba/OMuTXW5s0P7Tsg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Messenger-Pro/8.05wpb1 (RemoteNB/3.13) (RISC-OS/4.42)
X-Editor: EmailEdit 2.04
X-Notice: Filtered by postfilter v. 0.9.2
 by: Paul Stewart - Sun, 2 Jan 2022 21:56 UTC

In message <65baa8a459.harriet@bazleyfamily.co.uk>
Harriet Bazley <harriet@bazleyfamily.co.uk> wrote:

>>L.
> 10 PROCarray
> 16 PRINT D$(1)
> 17 END

> 20 DEF PROCarray
> 30 LOCAL D$()
> 40 DIM D$(7)
> 50 D$(1)="hat"
> 55 PRINT "array", D$(1)
> 60 ENDPROC

>>RUN
> array hat
> Undimensioned array at line 16

Thanks for this. Your code works perfectly.
Calling your PROCarray procedure twice, again works as expected.

Trying the same in my code, "Arrays cannot be redimensioned" error.

"Argh"

Something in my code not not right, so will take another look.

Thanks very much for your response.

--
Paul Stewart
Sent from A9home running RISC OS 4.42

Re: Arrays in BASIC

<59a4ae6e72News03@avisoft.f9.co.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=78&group=comp.sys.acorn.programmer#78

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!news.swapon.de!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder1.feed.usenet.farm!feed.usenet.farm!border1.nntp.ams1.giganews.com!nntp.giganews.com!buffer1.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 02 Jan 2022 16:05:02 -0600
From: New...@avisoft.f9.co.uk (Martin)
Subject: Re: Arrays in BASIC
Newsgroups: comp.sys.acorn.programmer
Date: Sun, 02 Jan 2022 22:04:03 +0000 (GMT)
Message-ID: <59a4ae6e72News03@avisoft.f9.co.uk>
References: <3261a6a459.Paul@outlook.com> <65baa8a459.harriet@bazleyfamily.co.uk>
User-Agent: Pluto/3.19a (RISC OS/5.29) NewsHound/v1.54
Organization: None
Lines: 22
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-bNRmUgCkvqbyV3OG62eGNaQfb0lnUFJIvhhzMXwVjrOtZsL8Kbww4x6bXRf0g2lE/5HKYPXvLoObOB9!tIjwg4IisknC0v4NvLJmD/gSee08UYuYJAwZaXl+eIEnnsMQrfLl7GE69worVZ6Jv7jK9fPOrbkz!//w=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1570
X-Received-Bytes: 1793
 by: Martin - Sun, 2 Jan 2022 22:04 UTC

In article <65baa8a459.harriet@bazleyfamily.co.uk>,
Harriet Bazley <harriet@bazleyfamily.co.uk> wrote:
> On 2 Jan 2022 as I do recall,
> Paul Stewart wrote:

> > Need to pick you brains on Arrays.

> > Looking at Arrays in the Archimedies User Guide (vintage July
> > 1987),

[Snip solution from Harriet]

But that manual is 35 years old (gosh!)

You should download the BASIC manual from
https://www.riscosopen.org/content/downloads/common
which is *much* more up to date!

--
Martin Avison
Note that unfortunately this email address will become invalid
without notice if (when) any spam is received.

Re: Arrays in BASIC

<6cc2afa459.Paul@outlook.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=79&group=comp.sys.acorn.programmer#79

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!aioe.org!U/KX8ba/OMuTXW5s0P7Tsg.user.46.165.242.75.POSTED!not-for-mail
From: narrowbo...@outlook.com (Paul Stewart)
Newsgroups: comp.sys.acorn.programmer
Subject: Re: Arrays in BASIC
Date: Sun, 02 Jan 2022 22:18:33 GMT
Organization: Aioe.org NNTP Server
Lines: 47
Message-ID: <6cc2afa459.Paul@outlook.com>
References: <3261a6a459.Paul@outlook.com> <65baa8a459.harriet@bazleyfamily.co.uk> <12c0ada459.Paul@outlook.com>
Injection-Info: gioia.aioe.org; logging-data="57890"; posting-host="U/KX8ba/OMuTXW5s0P7Tsg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Messenger-Pro/8.05wpb1 (RemoteNB/3.13) (RISC-OS/4.42)
X-Notice: Filtered by postfilter v. 0.9.2
X-Editor: EmailEdit 2.04
 by: Paul Stewart - Sun, 2 Jan 2022 22:18 UTC

In message <12c0ada459.Paul@outlook.com>
Paul Stewart <narrowboat-paul@outlook.com> wrote:

> In message <65baa8a459.harriet@bazleyfamily.co.uk>
> Harriet Bazley <harriet@bazleyfamily.co.uk> wrote:

>>>L.
>> 10 PROCarray
>> 16 PRINT D$(1)
>> 17 END

>> 20 DEF PROCarray
>> 30 LOCAL D$()
>> 40 DIM D$(7)
>> 50 D$(1)="hat"
>> 55 PRINT "array", D$(1)
>> 60 ENDPROC

>>>RUN
>> array hat
>> Undimensioned array at line 16

> Thanks for this. Your code works perfectly.
> Calling your PROCarray procedure twice, again works as expected.

> Trying the same in my code, "Arrays cannot be redimensioned" error.

> "Argh"

> Something in my code not not right, so will take another look.

> Thanks very much for your response.

Turns out, there were two arrays in the same procedure.
Having fixed the first one by making it local, just got fixated on that
array. Having looked at the line number again that the error was being
reported against, it was actually the second array it was complaing about.

Now moved dimensioning of second array out of the procedure, and all is
working as expected.

Again, thanks for your assistance with dimensioning a local array.

--
Paul Stewart
Sent from A9home running RISC OS 4.42

Re: Arrays in BASIC

<d014b2a459.harriet@bazleyfamily.co.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=80&group=comp.sys.acorn.programmer#80

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: harr...@bazleyfamily.co.uk (Harriet Bazley)
Newsgroups: comp.sys.acorn.programmer
Subject: Re: Arrays in BASIC
Date: Sun, 02 Jan 2022 22:43:55 GMT
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <d014b2a459.harriet@bazleyfamily.co.uk>
References: <3261a6a459.Paul@outlook.com> <65baa8a459.harriet@bazleyfamily.co.uk> <59a4ae6e72News03@avisoft.f9.co.uk>
Injection-Info: reader02.eternal-september.org; posting-host="047d3f776340ab27322e3cb2ada5d8c7";
logging-data="12906"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX189Le5n8NzXIVx9otXizYmejXkWoxmRygM="
User-Agent: Messenger-Pro/8.04 (MsgServe/8.04) (RISC-OS/5.27) NewsHound/v1.53-32 RC1
Cancel-Lock: sha1:dzKqh8y1Vjr+hzNm38DCOrVqmfM=
X-Clacks-Overhead: GNU Terry Pratchett
 by: Harriet Bazley - Sun, 2 Jan 2022 22:43 UTC

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....

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"

--
Harriet Bazley == Loyaulte me lie ==

But I don't like Spam!!!!

Re: Arrays in BASIC

<59a4b535ebNews03@avisoft.f9.co.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=81&group=comp.sys.acorn.programmer#81

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!border1.nntp.ams1.giganews.com!nntp.giganews.com!buffer1.nntp.ams1.giganews.com!buffer2.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 02 Jan 2022 17:18:28 -0600
From: New...@avisoft.f9.co.uk (Martin)
Subject: Re: Arrays in BASIC
Newsgroups: comp.sys.acorn.programmer
Date: Sun, 02 Jan 2022 23:18:05 +0000 (GMT)
Message-ID: <59a4b535ebNews03@avisoft.f9.co.uk>
References: <3261a6a459.Paul@outlook.com> <65baa8a459.harriet@bazleyfamily.co.uk> <59a4ae6e72News03@avisoft.f9.co.uk> <d014b2a459.harriet@bazleyfamily.co.uk>
User-Agent: Pluto/3.19a (RISC OS/5.29) NewsHound/v1.54
Organization: None
Lines: 29
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-FLWNqD+yQXjGbGefDpsBCJbwif1RQ/CvGLOkjcyFKohOCEQUFVpbUkMVoIKGypRF1qcYFkfz0ungBDJ!CrzehBNWQye68FkzYiKZ1rDZsrHMtjj1/EbiCveVpIdnyxi/MrZw9b/Qo9xaq/vh1jqMBLr5p+er!enk=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2104
 by: Martin - Sun, 2 Jan 2022 23:18 UTC

In article <d014b2a459.harriet@bazleyfamily.co.uk>,
Harriet Bazley <harriet@bazleyfamily.co.uk> 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....

> 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"

I should perhaps have pointed out that the manual I referred to
includes updates for recent versions of BASIC (see section on
changes) and I have noticed that Paul is running RO4.42 ... so may
not have a recent version, though it can be run in ancient versions
of RISC OS.

--
Martin Avison
Note that unfortunately this email address will become invalid
without notice if (when) any spam is received.

Re: Arrays in BASIC

<squgo7$nvs$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=82&group=comp.sys.acorn.programmer#82

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!aioe.org!ObcZWr9Rx1AOFFzsaJRN5A.user.46.165.242.91.POSTED!not-for-mail
From: ste...@kappa.me.uk (Steve Drain)
Newsgroups: comp.sys.acorn.programmer
Subject: Re: Arrays in BASIC
Date: Mon, 3 Jan 2022 09:46:26 +0000
Organization: Aioe.org NNTP Server
Message-ID: <squgo7$nvs$1@gioia.aioe.org>
References: <3261a6a459.Paul@outlook.com>
<65baa8a459.harriet@bazleyfamily.co.uk> <59a4ae6e72News03@avisoft.f9.co.uk>
<d014b2a459.harriet@bazleyfamily.co.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="24572"; posting-host="ObcZWr9Rx1AOFFzsaJRN5A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:52.0) Gecko/20100101
Thunderbird/52.9.1
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Steve Drain - Mon, 3 Jan 2022 09:46 UTC

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.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor