Page 2 of 4

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Posted: Sun Nov 18, 2018 8:26 pm
by 1024MAK
Shaun_B wrote: Sun Nov 18, 2018 7:43 pm
1024MAK wrote: Sun Nov 18, 2018 3:08 pm For me, the most annoying limitation of the ZX80 and ZX81 BASICs is no multi-statement lines :(
This is the apparent annoyance with ZX Spectrum BASIC (and all other variants except for ZX80/81 BASIC) because multi-statemented BASIC lines might make it more difficult to debug.
Maybe, but this is how I did things:

Code: Select all

10 REM Hardware port test program
20 CLS : LET exit=0
30 LET port=255: LET data=0
40 PRINT “Hardware port test program”
50 PRINT “Enter a port address, then data to output to port.”
100 FOR M=1 TO 1 STEP 0: REM Main loop
110 GO SUB 1000: REM Get User input
120 GO SUB 2000: REM Output to external hardware
130 GO SUB 3000: REM Update screen
140 IF exit THEN LET M=2: REM ‘exit’ set if user wants to end
150 NEXT M
160 CLS
170 GO TO 9999: REM jump to last line, then end.
Mark

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Posted: Sun Nov 18, 2018 10:01 pm
by Shaun_B
Also something else considered bad practise - same line comments ;-)

Regards,

Shaun.

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Posted: Wed Nov 21, 2018 12:14 am
by Crayon21
Shaun_B wrote: Sun Nov 18, 2018 10:01 pm Also something else considered bad practise - same line comments ;-)

Regards,

Shaun.


same line comments?

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Posted: Thu Nov 22, 2018 5:47 am
by mrtinb
I might add that ZX Basic has a feature that Commodore Basic is missing:

PRINT AT

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Posted: Thu Nov 22, 2018 10:00 pm
by Shaun_B
Crayon21 wrote: Wed Nov 21, 2018 12:14 am
Shaun_B wrote: Sun Nov 18, 2018 10:01 pm Also something else considered bad practise - same line comments ;-)

Regards,

Shaun.


same line comments?
Yes, like this:

Code: Select all

10 PRINT "Hello ";: GO TO 10: REM This is an inline comment
It's kind of considered common practise in assembly, but not so in high-level languages. But then who cares about coding standards and such?

Regards,

Shaun.

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Posted: Sat Nov 24, 2018 6:11 pm
by gammaray
Of course! Do what works for you... I, for what it counts, like this method.

I have seen this in U.S. (SOME) coding if I am not mistaken. Also with Linux bash scripts.

If your working on a team though, they might squeal!!

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Posted: Sun Dec 02, 2018 3:50 am
by Crayon21
Shaun_B wrote: Sun Nov 18, 2018 11:16 am The biggest difference, of course, is that the ZX81 ROM is 8K whereas the BASIC Kernal on the Commodore VIC-20 is 16k, therefore Commodore BASIC was more verbose.

Regards,

Shaun.
verbose how?

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Posted: Sun Dec 02, 2018 10:37 am
by mrtinb
Explaining error messages.

But the Commodore Basic also saved commands as tokens.

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Posted: Mon Dec 10, 2018 9:30 am
by Shaun_B
Crayon21 wrote: Sun Dec 02, 2018 3:50 am verbose how?
More commands, may use GOTO and GO TO and data handling can handle strings without quotation marks in some cases. There are 71 commands.

Also allows to define simple mathematical functions to be defined and called anywhere.

I am of course comparing ZX80/81 BASIC to BASIC V2 as described by this sub-forums description.

Regards,

Shaun.

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Posted: Mon Dec 10, 2018 4:09 pm
by Moggy
Mathematical functions simple and complex can be defined within a string in zx81 basic and the evaluation of said function, after whatever values needed are entered, can be called by simply asking the strings value.