Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Control codes
#1
Hi
I'm new here, so excuse me if anyone asked this before. I tryed to search for it but didnt find anything.

So i'm playing with ZX basic for last week or so and i was doing some of my usual tests.
In one of them i was trying to print out a block of characters with random ink and color. And because making a loop that will print it character by character is rather slow, i tryed to be clever. It didn't work ^_^

So my problem:

i wanted to make a string variable with control codes that i would print out. And sure enough if i do

p$="\{i5}X"
print p$

it work just fine.


Problem is when i want to put some randomness to it and do something like

i$=str(int(rnd*7))
p$="\{i"+i$+"}X"
print p$

it outputs

\{i2}X

instead of colored X. In my mind, it should work...
Am i doing something wrong?

Also, implementing AT as \{ax,y} like it works in BASin would be nice ^_^

Thanks for your help
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)