FAQ  •  Register  •  Login

sgn fails if the argument is a variable

<<

britlion

Posts: 766

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Sat Apr 08, 2017 4:18 pm

sgn fails if the argument is a variable

zxb version 1.4.0-s1980

  Code:
dim y as uByte=1
print sgn y
print sgn 2



This wont compile. sgn <number> is fine. sgn variable isn't.


  Code:
Traceback (most recent call last):
  File "zxb.py", line 348, in <module>
  File "zxb.py", line 274, in main
  File "ast_\ast.pyc", line 34, in visit
  File "arch\zx48k\translator.pyc", line 340, in visit_UNARY
api.errors.InvalidOperatorError: Invalid operator "SGN"
Build Failed!



Definitely a regression, as it worked fine with an older compiler!
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Mon Apr 10, 2017 9:37 am

Re: sgn fails if the argument is a variable

Thanks Britlion!! :roll: (BTW nice to see you here!)
BTW I've reactivated ZX Basic development, finally.
Will address it ASAP. :!:
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Mon Apr 10, 2017 8:24 pm

Re: sgn fails if the argument is a variable

Ok, I think it's fixed.

Can you download ZXBasic 1.4.0s1995
and check if it works ok? :roll:
I've added some tests, but not sure if the coverage is complete (Float, Fixed, Uinteger, Integer, Long... etc)

Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest

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

phpBB SEO