FAQ  •  Register  •  Login

Problems with -Z option (*solved*)

<<

LTee

Posts: 119

Joined: Tue Jul 07, 2009 2:54 pm

Post Fri Feb 18, 2011 1:36 pm

Problems with -Z option (*solved*)

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.
Last edited by LTee on Fri Feb 18, 2011 1:54 pm, edited 1 time in total.
<<

boriel

Site Admin

Posts: 1146

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Fri Feb 18, 2011 1:44 pm

Re: compiler error

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?
<<

LTee

Posts: 119

Joined: Tue Jul 07, 2009 2:54 pm

Post Fri Feb 18, 2011 1:53 pm

Re: compiler error

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.
<<

boriel

Site Admin

Posts: 1146

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Fri Feb 18, 2011 10:44 pm

Re: Problems with -Z option

Okay, they were 2 compiler bugs!
Download v1.2.7-r2087, and test it please! :roll:
<<

LTee

Posts: 119

Joined: Tue Jul 07, 2009 2:54 pm

Post Mon Feb 21, 2011 11:51 am

Re: Problems with -Z option

Sorry for the delay, a sick family kept me busy over the weekend. :(

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. :)
<<

boriel

Site Admin

Posts: 1146

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Mon Feb 21, 2011 12:07 pm

Re: Problems with -Z option

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.
<<

LTee

Posts: 119

Joined: Tue Jul 07, 2009 2:54 pm

Post Mon Feb 21, 2011 12:37 pm

Re: Problems with -Z option

Unfortunately 2096 is the one I have already. :)
<<

boriel

Site Admin

Posts: 1146

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Mon Feb 21, 2011 12:58 pm

Re: Problems with -Z option

LTee wrote:Unfortunately 2096 is the one I have already. :)

Quite strange, I used ATTR in 2 tests programs, and It worked ok if no -Z parameter specified. :oops:
Let me check it again...
<<

LTee

Posts: 119

Joined: Tue Jul 07, 2009 2:54 pm

Post Mon Feb 21, 2011 1:23 pm

Re: Problems with -Z option

I will do the same. :-)
<<

boriel

Site Admin

Posts: 1146

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Mon Feb 21, 2011 6:17 pm

Re: Problems with -Z option

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.
<<

slenkar

Posts: 257

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Mon Feb 21, 2011 8:22 pm

Re: Problems with -Z option

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
<<

boriel

Site Admin

Posts: 1146

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Mon Feb 21, 2011 8:46 pm

Re: Problems with -Z option

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.
<<

boriel

Site Admin

Posts: 1146

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Mon Feb 21, 2011 9:21 pm

Re: Problems with -Z option

Please, redownload now v1.2.7r2098 and test: http://www.boriel.com/wiki/en/index.php ... nt_Version
<<

slenkar

Posts: 257

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Mon Feb 21, 2011 11:37 pm

Re: Problems with -Z option

yep , works now thanks :)
<<

LTee

Posts: 119

Joined: Tue Jul 07, 2009 2:54 pm

Post Tue Feb 22, 2011 10:02 am

Re: Problems with -Z option

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. :)
Next

Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO