Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Line Feed and ",," bug (*solved*)
#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


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)