Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Control codes
#2
BASIN has its own codes. ZX BASIC is a compiler, so it tries to guess some (a few of them!) at compile time. NOT at runtime.
It's much faster if you use the ink code which is CHR(16) (Read here).
So instead of
Code:
p$="{\i" + x$ + "}X"
use
Code:
p$=CHR$(16) + i$ + "X";

Actually, CHR$ is optimized for several chars at once. So CHR$(x) + CHR$(y) + CHR$(z) + ... can be written as CHR$(x, y, z, ...). Example:
Code:
p$ = CHR$(16, INT(RND * 7), CODE "X")
Give it a try. Also, in this case, you can ignore the INT( )... because CHR$ will take only INT args and do it for you.
Tell me is this work for you :roll:
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)