Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems with -Z option (*solved*)
#1
I seem to be having some weird problems with this latest version.

If I'm compiling without the -Z flag (which provides the extra Speccy stuff like ATTR) then it keeps complaining about "illegal preprocessor characters" in REM statements and doesn't compile. Specifically it seems to be punctuation which is throwing it out - ?, !, etc.

If I do use -Z (or strip those characters out of the REM statements) then it seems to be a coin-toss as to whether I get a workable program or not. Many of my files are compiling to very small TZXs which load and run but do nothing at all (in those cases the compilation seems suspiciously fast).

As a test, I make a simple program like this:
Code:
print "hello world"

If I compile with:
zxb.py test.bas -T -B -a

... then I get a working TZX.

But if I compile with:
zxb.py test.bas -T -B -a -Z

... I get a TZX that loads but does nothing.

If I make the file:
Code:
rem test!
print "hello world"

... then without -Z compilation fails, with -Z compilation succeeds but the program does nothing.


Is anyone else having similar issues? I'm using the Python-based version of 2077 (from the zip) with Python 2.7.1.
Reply
#2
Hmm. This could be due to the new preprocessor. Did it happen in the former ZX BASIC 1.2.7 r20xx versions? I guess so.
How could I reproduce the bug? Maybe using the -Z flag is enough?
Reply
#3
I've been very busy with work, sadly - this is the first 20xx version that I've tried. So it may have been a problem before, but I couldn't say. Sorry! :-)

Recreating the very simple programs in my post above should allow you to replicate the issues, I think. Unless it's something unique to my environment.
Reply
#4
Okay, they were 2 compiler bugs!
Download v1.2.7-r2087, and test it please! :roll:
Reply
#5
Sorry for the delay, a sick family kept me busy over the weekend. Sad

Anyway, I've given this a test and there is both good news and bad.

The good news is that the compiler error with punctuation in REM statements seems to be gone - thanks!

The bad news is that I don't seem to be able to get the -Z option to work at all now. On source which requires this flag, the compiler fails with an "Undeclared function "ATTR"" error as soon as it reaches a line which uses ATTR, regardless of whether I pass -Z or not. Smile
Reply
#6
Well, I posted in another topic I uploaded a new release (r2096) just yesterday. Please check it, as It might also fix that issue.
Download here as always.
Reply
#7
Unfortunately 2096 is the one I have already. Smile
Reply
#8
LTee Wrote:Unfortunately 2096 is the one I have already. Smile
Quite strange, I used ATTR in 2 tests programs, and It worked ok if no -Z parameter specified. :oops:
Let me check it again...
Reply
#9
I will do the same. :-)
Reply
#10
Ok, it seems we really have a problem here. You and slenkar are reporting bugs I can't reproduce (both neither in windows nor in Linux). Please, uninstall ZX Basic and reinstall it. This is really starting to worrying me. Also, a new unpacked .exe (zipped) version will be available in brief to test the compiler without installing it on Windows.

both slenkar and you are having problems with
Code:
PRINT "Hello world"
Which is the first the compiler pass on each release! :!:
(and yes, I've just tested it)

Update: Just uploaded a .zip file with .exe's (no installer needed) :wink: as LCD suggested. Go here to download.
Reply
#11
it does the same thing


if you put anything after the print statement it WILL work

if you just have print "hello" on the FIRST LINE and nothing else it wont work
Reply
#12
slenkar Wrote:it does the same thing


if you put anything after the print statement it WILL work

if you just have print "hello" on the FIRST LINE and nothing else it wont work
Got it! Ok.
It's just
Code:
PRINT "HELLO WORLD"
The VERY FIRST line with no EOL (carriage return). Ok... Fixing... (Thanks! ;-))

Note: adding an ENTER after PRINT workarounds this bug.
Reply
#13
Please, redownload now v1.2.7r2098 and test: <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Archive#Latest_Development_Version">http://www.boriel.com/wiki/en/index.php ... nt_Version</a><!-- m -->
Reply
#14
yep , works now thanks Smile
Reply
#15
Sorry for being a pest, boriel, but I still can't get this working if I use the -Z option.

If I try to compile the following with 2098:
Code:
PRINT ATTR(0,0)

using the command line:
Code:
zxb attrtest.bas -T -B -a -Z

I still get this:
Code:
attrtest.bas:1: Undeclared function "ATTR"

Things I've tried:
1. Adding a carriage return after the single line of code.
2. Using the .exe version of 2098 rather than the .py version.
3. Installing a clean copy of ZX Basic to a new folder in the root directory of my C drive.
4. Swapping the case of the function from 'ATTR' to 'attr' (you never know!).
5. Using #include to manually include the attr.bas file, both using <attr.bas> and "attr.bas" (with the file copied from the library folder)

All of these things have made no difference if using -Z, I just get the 'undeclared function' error.

However, point 5 above (#including attr.bas) DOES work if I leave the -Z option off! I only get the fail message if I include -Z.

So I have a workaround for that, but I have no idea why my setup is having such problems with -Z. I'll try the same tests on my home machines under Windows 7 and Linux tonight (this machine is Windows XP Pro) and see if I get the same issues there. Smile
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)