[GTALUG] For Chris: Commodore BASIC as a scripting language

Christopher Browne cbbrowne at gmail.com
Wed Aug 14 13:24:16 EDT 2019


On Tue, 13 Aug 2019 at 22:18, Stewart Russell via talk <talk at gtalug.org>
wrote:

> This is not a place of honour:.
>
> https://github.com/mist64/cbmbasic
>
> Go do some damage!
>

My first assumption had been that this wouldn't have any access out into
the filesystem.

Oh, my, given that it does allow opening files, you could indeed do some
"real" tasks with this.  And do some real damage!

I don't want to think about looping through files, but it could reasonably
be used to process a file!

cbbrowne at cbbrowne2 ~/G/c/test> cat fileio.bas

                           130 master?
10 OPEN 1,1,1,"TEST.DAT"
20 PRINT#1, 1234
30 PRINT#1, "Hello"
40 CLOSE 1

50 OPEN 2,1,0,"TEST.DAT"
60 INPUT#2, A
70 INPUT#2, I$
80 CLOSE 2

90 PRINT A
100 PRINT I$

The prime number sieve (which does not capture primes into an array, hence
never speeds up searches by avoiding dividing by non-primes) is
surprisingly fast, all given, finding the first 11302 primes in about 11
seconds.

I'm with Hugh on being disappointed not to have the Waterloo "structured
BASIC" extensions.

That said, I hated Structured BASIC at the time; it prevented me from
handing in assignments on tiny slips of paper, which inevitably led to the
teacher losing my assignment because the piece of paper fell out when he
was shuffling papers.  Oh, the good times of doing matrix calculations in
Grade 12 "Computer Science"...
-- 
When confronted by a difficult problem, solve it by reducing it to the
question, "How would the Lone Ranger handle this?"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gtalug.org/pipermail/talk/attachments/20190814/35dee2fb/attachment.html>


More information about the talk mailing list