Post by tsh73 on Dec 7, 2023 11:50:45 GMT -5
Now, I am not sure it's a bug
but it totally unexpected for me
amd I just checked - it works the same in LB5
It's rather obscure thing, might be as well nobody tripped over it yet.
For one project (soon to be seen) I need lots of printing to manwin
sort of fast changing text frames
So I assembled long string as
and
Now, to clear to next frame, I could just CLS
And it works
But I wondered "will it be any faster of instead of CLS I set cursor position to the 1,1 and then overtype?"
And it happens that it does not overtype.
Actually it overtypes one line, but since I have other lines chained with chr$(13), other lines ARE INSERTED
(instead of overtyped.)
It looks like this
demo code
but it totally unexpected for me
amd I just checked - it works the same in LB5
It's rather obscure thing, might be as well nobody tripped over it yet.
For one project (soon to be seen) I need lots of printing to manwin
sort of fast changing text frames
So I assembled long string as
buf$=line1$+chr$(13)+line2$+chr$(13)+line3$+chr$(13)+...
and
print buf$
naturally shows whole frame.Now, to clear to next frame, I could just CLS
And it works
But I wondered "will it be any faster of instead of CLS I set cursor position to the 1,1 and then overtype?"
And it happens that it does not overtype.
Actually it overtypes one line, but since I have other lines chained with chr$(13), other lines ARE INSERTED
(instead of overtyped.)
It looks like this
Initial pattern
# #
# # #
# #
# # #
# #
Overtyping with LOCATE (expected)
# #
11111111111111111111111
22222222222222222222222
33333333333333333333333
# #
And now for something special
Overtyping INSERTS lines!!!
(it owertype one but adds two more!!)
# #
# # #
11111111111111111111111
22222222222222222222222
33333333333333333333333
# # #
# #
demo code
print "Initial pattern"
gosub [drawPattern]
print
print "Overtyping with LOCATE (expected)"
gosub [drawPattern]
locate 1, 10 'col row
print "11111111111111111111111"
print "22222222222222222222222"
print "33333333333333333333333"
locate 1, 15
print "And now for something special"
print "Overtyping INSERTS lines!!!"
print "(it owertype one but adds two more!!)"
gosub [drawPattern]
locate 1, 20 'col row
print "11111111111111111111111"+chr$(13)+_
"22222222222222222222222"+chr$(13)+_
"33333333333333333333333"
end
[drawPattern]
for y = 1 to 5
for x = 1 to 5
print sample$(x, y); " ";
next
print
next
return
function sample$(x, y)
'# draw an alternating checkboard pattern
if (x + y + time$("seconds")) mod 2 then
sample$= "#"
else
sample$= " "
end if
end function