For all you SCREEN 0 herpes out there like Pete, here's PutText -- it's like PutImage, but for TextScreens!
PutText "(10,1)", FooBar, 0, "(1,1) to (10,3)"
'let's try to put the text at an off image coordinate
PutText "(0,0)", FooBar, 0, "(1,1) to (10,5)"
'or off the right of the screen
PutText "(75,20)", FooBar, 0, "(1,1) to step (9,2)"
x = 80
PutText
Str$(x
) + ",3", FooBar
, 0, "(1,1) to step (9,2)" x = x - 1
Sub PutText
(dest$
, source
, dest
, source$
)
ParsePutParam dest$, d
ParsePutParam source$, s
For x
= s.x1
To s.x2
'Step Sgn(s.x2 - s.x1) For y
= s.y1
To s.y2
'Step Sgn(s.y2 - s.y1) x1 = d.x1 + x - s.x1: y1 = d.y1 + y - s.y1
Sub ParsePutParam
(param$
, o
As PutType
) strip$ = "() "
o.x2
= o.x1: o.y2
= o.y1: p$
= Mid$(p$
, 5) o.x2 = 0: o.y2 = 0
I was going to build this to work more like PutImage, but then I realized that wouldn't be possible with a text screen. For instance, there's no way to stretch or scale the "image" here, since all text screens are stuck with a single font in use at a time, so I figured all I really needed was a singular destination point (x,y) rather than (x,y) to (x2,y2).
Get the portion of text you want, put it where you want it. It's that simple.
Another little change is that I tweaked the syntax to use "TO" instead of a dash ("-") to separate points. You never know -- somebody, somewhere, might be using WINDOW to work with negative screen coordinates, so I didn't want to run into issues with that dash getting screwed up with the parsing of a negative location. "(10,10) TO STEP (-10,0)", for an example.
Currently I'm only printing text in an incremental fashion (from position 0 to 10, for instance rather than from 10 to 0), but I do plan on adding in the optionality later for bidirectional putting of text so we can reverse and flip text as wanted with one little command. (I'll just need to wake up enough to sort out how to do it first! LOL!)