Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Line Feed and ",," bug (*solved*)
#1
Just one small question. How to make Line Feed with Print with ZXBC?
in Sinclair BASIC this worked:
Code:
Print "Line1" ' "Line2"
But in ZXBC the '-Character is used for REM, and ´ and ` are illegal characters for the compiler.

It looks also like I stepped on a bug in release 809 (maybe in earlier versions too:
Code:
Print at 0,0;"Spectrum users to celebrate the",,"30th birthday of our Speccy.";

the double coma should leave one line free, but in fact it prints the character "3" at Position x=31,y=1, where it should be position x=0,y=2.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply
#2
LCD Wrote:Just one small question. How to make Line Feed with Print with ZXBC?
in Sinclair BASIC this worked:
Code:
Print "Line1" ' "Line2"
But in ZXBC the '-Character is used for REM, and ´ and ` are illegal characters for the compiler.
This was discussed in other thread I think. It was decided to use ' as a REM alternative, because it's widely extended and it's almost a standard (e.g. FreeBasic, Visual Basic, etc).
We concluded to use CHR$(13) instead. So use:
Code:
PRINT "Line1"; CHR$(13); "Line2"
instead.
LCD Wrote:It looks also like I stepped on a bug in release 809 (maybe in earlier versions too:
Code:
Print at 0,0;"Spectrum users to celebrate the",,"30th birthday of our Speccy.";

the double coma should leave one line free, but in fact it prints the character "3" at Position x=31,y=1, where it should be position x=0,y=2.
I will check it out. There were a complete PRINT work out some versions ago to fix a bug: Sinclair BASIC crashed upon exit or gave an error. Also it this change made the routine faster and shorter.

Update: It should print the "3" at x = 16, y = 1!!! (execute it in Sinclair BASIC). And yes, it's bugged anyway.
Reply
#3
boriel Wrote:
LCD Wrote:Just one small question. How to make Line Feed with Print with ZXBC?
in Sinclair BASIC this worked:
Code:
Print "Line1" ' "Line2"
But in ZXBC the '-Character is used for REM, and ´ and ` are illegal characters for the compiler.
This was discussed in other thread I think. It was decided to use ' as a REM alternative, because it's widely extended and it's almost a standard (e.g. FreeBasic, Visual Basic, etc).
We concluded to use CHR$(13) instead. So use:
Code:
PRINT "Line1"; CHR$(13); "Line2"
instead.
Thanks, sometime I dont see the forest because of all the trees...
But by replacing it with:
Code:
Print "Line1"+chr(10)+"Line2"
I saved over 10 Bytes per line... No idea why exactly, but very nice.
boriel Wrote:
LCD Wrote:It looks also like I stepped on a bug in release 809 (maybe in earlier versions too:
Code:
Print at 0,0;"Spectrum users to celebrate the",,"30th birthday of our Speccy.";

the double coma should leave one line free, but in fact it prints the character "3" at Position x=31,y=1, where it should be position x=0,y=2.
I will check it out. There were a complete PRINT work out some versions ago to fix a bug: Sinclair BASIC crashed upon exit or gave an error. Also it this change made the routine faster and shorter.

Update: It should print the "3" at x = 16, y = 1!!! (execute it in Sinclair BASIC). And yes, it's bugged anyway.
Thats right, it should put it at x=16,y=1. I checked it in emulator with two different strings.
Reply
#4
I think I have fixed it.
Can you download an check 1.2.9-s815, please? Try and tell me Smile
Reply
#5
boriel Wrote:I think I have fixed it.
Can you download an check 1.2.9-s815, please? Try and tell me Smile
Jose, you are really fast... I will check it when I'm back at home.
So my next game is on the way, I think Smile. This time it will be maybe a little "Mojonish" (NSFW).

Edit: Checked it, this bug is fixed!
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)