Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PRINT bug using CHR$(22) for inline positioning (*solved*)
#1
Bug 
It seems as if the compiler gets this wrong when the x coord is greater than 27. See example:
Code:
DIM a$, b$ AS String
CLS
a$=CHR(22,17,27,65,66) 'PRINT AT 17,27;"AB" - fine
b$=CHR(22,18,28,67,68) 'PRINT AT 18,28;"CD" - wrong location (19,0)
c$=CHR(22,19,29,69,70) 'PRINT AT 19,29;"EF" - wrong location (20,0)
PRINT a$;b$;c$
PRINT AT 20,28;"GH"                        '- fine
PRINT AT 18,0;"--"                         '- fine

At x=28 there is adequate space to print the two characters "CD" before the line wrap,  but strangely they end up being PRINTed AT 19,0 instead of AT 18,28. I presume it's because the compiler is forgetting that CHR$(22) and the following two special characters do not count towards the PRINTed length of the string. Will this error also occur for the other inline control codes for INK, PAPER, BRIGHT, OVER, etc.?

This error is present in the the latest stable release 1.13.2, and the betas for 1.14 (which I gather had some PRINT changes). Being able to set the coordinates and attributes inline like this is useful for manipulating pre-formed sprites.
Reply


Messages In This Thread
PRINT bug using CHR$(22) for inline positioning (*solved*) - by patters - 12-30-2020, 01:09 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)