Unexpected Syntax Error in C64 Basic

laurens
Posts: 6
Joined: Tue Aug 22, 2023 9:10 am
Has thanked: 9 times

Unexpected Syntax Error in C64 Basic

Unread post by laurens »

Hi - complete c64 novice here.

I found that the line

Code: Select all

10 PRINT CHR$(205.5+RND(1)); : GOTO 10 

supposedly gives a nice pattern when executed on the C64.

However, I get a syntax errror when I try it;

I boiled it down to RND(1) not working.

I'm running stock c64 after an update_all with biosses. The line at the top says commodore 64 basic V2, followed by dolphindos 2.0.

I also tried loading the 'standard' system rom, instead of the 'Loadable C64', but the result is the same. Quick internet search did not yield answers. Any clues, experts?

Bas
Top Contributor
Posts: 622
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: Unexpected Syntax Error in C64 Basic

Unread post by Bas »

Works in Vice as well as MiSTer for me. Do make sure you get an actual + sign and don't mix up your ; and :. Those are tricky from my PC keyboard attached to the MiSTer and fudged up my first attempt.

...so you' re a Tweaker eh? ;-)

laurens
Posts: 6
Joined: Tue Aug 22, 2023 9:10 am
Has thanked: 9 times

Re: Unexpected Syntax Error in C64 Basic

Unread post by laurens »

:) so you're a tweaker, eh :)

But: yeah, I think I typed everything correct;

c64error.png
c64error.png (1.73 MiB) Viewed 803 times

So yeah, I'm a bit stumped. I don't believe I have any weird settings in mister's setup for the c64.

So, yeah, idk!

virtuali
Posts: 124
Joined: Mon Feb 01, 2021 10:41 pm
Has thanked: 2 times
Been thanked: 37 times

Re: Unexpected Syntax Error in C64 Basic

Unread post by virtuali »

That's not the plus sign! It's the PET-ASCII sign for the cross.

laurens
Posts: 6
Joined: Tue Aug 22, 2023 9:10 am
Has thanked: 9 times

Re: Unexpected Syntax Error in C64 Basic

Unread post by laurens »

Yup. Of course both of you were right, user error :) Thanks! It was the + that wasn't a plus. And I was surprized that excuting

Code: Select all

print "Hello" 

worked as I expected, so when

Code: Select all

rnd(1)

did not, I expected the syntax error to be due to my mister not being set up with the correct version of BASIC or something.

And just to clarify and prevent bans: Bas and I weren't calling eachother meth users - but referring to users of a Dutch tech website, tweakers.net :)

They reported on the passing of one of the inventors of BASIC, Thomas E. Kurtz. In the comments of the article, someone posted this oneliner, and I aimed to try it.

Post Reply