Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compiling pure Sinclair Basic
As per the subject, I'm trying to compile pure Sinclair Basic but am getting the following errors which I can't find anything about.

bwall.bas:4: Error: invalid directive #Run
bwall.bas:4: Error: illegal preprocessor character '-'

bwall.bas:68: Error: invalid directive #End
bwall.bas:68: Error: illegal preprocessor character '-'

I used this command: 'zxb bwall.bas --tzx --BASIC --autorun --sinclair --explicit' to compile
but have also tried without '--sinclair' and '--explicit' with the same results.

If anybody has any ideas I would be really appreciative. Thanks.
I think I'm getting somewhere.

I was trying to compile the .bas directly output from BasinC. I separated out a portion of the listing to use and when I copied it into a Notepad .txt file and compiled that it got past the directive and preprocessor errors above.

Once I had then added a line to declare all the variables, it compiled. Now to try with the full 38Kb program. I'm sure I'll get other issues with that, hope I can get past them too, it'll make the game playable!
--explicit enforces you to use DIM.
Try to use DIM to declare variables as bytes, ubytes, integers and uintegers. This will speed up your program (by default the type is guessed, and could be not accurate). Fixed is for decimal numbers from -32767.xxxx to aprox. And Floats are the Sinclair BASIC floats, they have much more precision, but are also bigger and slower (you don't usually need that).

DIM (declaring variables, not only arrays)

Hi boriel,
Thanks for the reply. I've done some reading of the links you gave, thank you.
I'm having a bit of trouble with errors for lines which are working fine in Sinclair Basic.
Would you mind giving me some pointers if you have time? (no worries if not)

GOTO INT (RND*4)*6+1380
Syntax Error: Unexpected token 'INT' <INT>

LET b$=CHR$ (161)
Cannot convert string to a value. Use VAL() function

Forum Jump:

Users browsing this thread: 1 Guest(s)