TV_Text format question
Paul_H
Posts: 85
Quick question today about the tv_text object.
When the first output to the TV screen is sent without using any locations information, the text appear at the top line of the screen. eg:
However, when I specify a screen location it is one line below this physical spot. eg:
Also the compiler complains when I try to enter a "0" for the line top.
If anyone has the answer, I do appreciate it!
Paul
When the first output to the TV screen is sent without using any locations information, the text appear at the top line of the screen. eg:
tv.str(string("This is at the top of the screen")
However, when I specify a screen location it is one line below this physical spot. eg:
tv.str(string($A,5,$B,1)) 'set screen position indent to the 5th column and 1st row. tv.str(string("This comes up on the second line"))
Also the compiler complains when I try to enter a "0" for the line top.
If anyone has the answer, I do appreciate it!
Paul
Comments
However a funny convention lent from C requires a text (!) string to be terminated by 0, which has nothing to do with the former convention.
The directive string(...) is aware of the latter convention but not of the former one
So no wonder you get confused. You have to use TV.OUT when zeroes are concerned..
Post Edited (deSilva) : 9/7/2007 8:48:07 PM GMT
This works:
Gracias!
Paul
I should like to use this opportunity to discuss another rarely used technique:
Using a "mask" in the DAT section.
The usage is:
Note there still is no cheating with the terminating zero: tv.str will merciless stop at any 0!
But you can make your own tv_str:
Post Edited (deSilva) : 9/7/2007 9:58:58 PM GMT
So without changing any code at all you could write:
tv.str(STRING(10, tv#cols, 11, tv#rows, "Upper Left Corner"))
Post Edited (deSilva) : 9/7/2007 10:47:24 PM GMT