02-15-2011, 07:55 AM
slenkar Wrote:im using the latest beta buildOk. Regardless your code, this is a compiler error. Thanks! :wink: Will fix it as soon as possible :!:
here is my source:
Code:BORDER 7 : PAPER 7 : INK 0 : CLS
PRINT AT 3,13 ; PAPER 1 ; INK 7 ; "BattleField"
PRINT AT 5,9 ; PAPER 7 ; INK 0 ; "Q - Up"
PRINT AT 6,9 ; PAPER 7 ; INK 0 ; "A - Down"
PRINT AT 7,9 ; PAPER 7 ; INK 0 ; "O - Left"
PRINT AT 8,9 ; PAPER 7 ; INK 0 ; "P - Right"
PRINT AT 9,9 ; PAPER 7 ; INK 0 ; "M - Select"
PRINT AT 10,3 ; PAPER 7 ; INK 0 ; "You have to select units"
PRINT AT 11,3 ; PAPER 7 ; INK 0 ; "to fight the enemy units"
PRINT AT 15,3 ; PAPER 7 ; INK 0 ; "Press any key to start"
60 LET j$ = INKEY$
IF j$ = "" THEN GOTO 60: END IF
cls
Dim BlueFactoryX (6) as uByte
Dim BlueFactoryY (6) as uByte
for x =1 to 6
BlueFactoryX(x) = byterndrange(1,30)
BlueFactoryY(x) = byterndrange(1,30)
next
drawFactories()
function drawFactories()
for x =1 to 6
print at BlueFactoryX(x), BlueFactoryY(x); "O"
next
end function
Function byterndrange (first As uByte, last As uByte) As uByte
return Rnd * (last - first) + first
End Function
here is the error message when I compile:
Quote:Traceback (most recent call last):
File "zxb.py", line 309, in <module>
File "zxb.py", line 242, in main
File "zxbtrad.pyc", line 316, in traverse
File "zxbtrad.pyc", line 1202, in traverse
File "zxbtrad.pyc", line 217, in emmit_let_left_part
TypeError: bad operand type for unary -: 'NoneType'
slenkar Wrote:also it seems that underscores are not allowed in function names, is this right?Not yet (the assembler does, though). I'm thinking to allow them. What do you think? (other people has asked for it).
It's a bit hard, because I used the "_" character as a namespace mangler. If the user declares "__PRINT", it can collide with the __PRINT subroutine in the /library-asm/ directory, and so on.