beta% = 1 ' Testing text
debug% = 0 ' Debugger stats.
scrb.opt = 0 ' Variable size scrollbar box.
updatescrn% = 0
' **************************** GOSUB ROUTINES *******************************
setvariables:
scrn.h = 25
margin.t = 3
margin.b = 3
margin.l = 5
margin.r = 5
border.thk = 0
border.stl = 1
ins% = 7
ovm% = 1 ' Change this to 0 for no over margin cursoring. 0 needed if right margin is at edge of screen.
scrn.w = 80
scrn.h = 25
dwidth = scrn.w - (margin.l + margin.r): dwidth2 = dwidth + 2
page.h
= scrn.h
- (margin.t
+ margin.b
+ CINT(border.thk
/ border.stl
+ .01))page.w = scrn.w - (margin.l + margin.r + border.thk * 2)
c1% = 7: c2% = 0: h1% = 15: h2% = 1 ' Normal text and highlighted text colors.
RETURN ' ==================================================================
betatestfile:
a$
= "Money's Short" + CHR$(255) + CHR$(255) + "Times Are Crap" + CHR$(255) + CHR$(255) + "Here's Your Flocking" + CHR$(255) + CHR$(255) + "Christmas App" i%
= (LEN(a$
) / dwidth
) * 2
wrap.on%
= -1:
GOSUB wrapper
filled% = page.h: row = 1
LOCATE margin.t
+ row
, margin.l
+ 1 RETURN ' ==================================================================
keyeffect:
x$
(row
+ scr
) = "" + CHR$(10): wrap.on%
= -1 x$
(row
+ scr
) = a$
+ CHR$(10)
aux$ = a$
RETURN ' ==================================================================
determinewrap:
IF row
> 1 OR scr
> 0 THEN ' Wrap to line above analysis. Determine if the line above the text input line should wrap up the first word of the text input. l0%
= dwidth
- (INSTR(x$
(row
- 2 + scr
+ 1), CHR$(10)) - 1) ' -1 chops off chr$(10) IF l0%
>= l1%
AND l1%
> 0 OR LEFT$(aux$
, 1) = CHR$(32) AND l0%
>= 0 THEN ' The line above has enough room to wrap up the first word of the current text line. x$
(row
+ scr
) = a$
+ CHR$(10) ' The current line array is changed to the current line of text input. a$
= MID$(x$
(row
- 1 + scr
), 1, INSTR(x$
(row
- 1 + scr
), CHR$(10)) - 1) ' The current line of text input is now the line above. scr
= scr
- 1:
GOSUB scrollscrn
row = row - 1
wrap.on% = -1
IF RIGHT$(aux$
, 1) <> CHR$(32) AND row
+ scr
< noe
OR INSTR(aux$
, CHR$(255)) THEN ' Delete last space of a text line, except the last line. Current line below will wrap to line below. wrap.on% = -1
xcurrent$ = aux$
xcurrent%
= dwidth
- LEN(xcurrent$
)
xbelow$ = "" ' Text line below is blank, but the line above may be too long and still needs to be wrapped down.
xbelow$
= MID$(x$
(row
+ 1 + scr
), 1, LEN(x$
(row
+ 1 + scr
)) - 1)
xbelow% = 1 ' Leading space.
IF xcurrent%
>= xbelow%
AND xbelow%
> 0 OR xcurrent%
< 0 THEN wrap.on% = -1
RETURN ' ==================================================================
wrapper:
start% = 1: ii% = 0: filled% = 0 ' Do not exit this routine without zeroing wrap.on%.
acut$ = a$ + acut$: a$ = ""
' Continue to concatenate until full text line or greater is achieved or until end of doc.
DO UNTIL ii%
>= noe
- (row
+ scr
) ' > is a precaution. I had one error where if failed to exit loop with = alone. acut$
= acut$
+ MID$(x$
(row
+ scr
+ ii%
+ 1), 1, INSTR(x$
(row
+ scr
+ ii%
+ 1), CHR$(10)) - 1) ' Cut off chr$(10). x$(row + scr + ii% + 1) = ""
ii% = ii% + 1
'==========================================================================================
' Cut text line and place into next text array. -------------------------------------------
MID$(acut$
, h%
, 1) = cur$
x$
= MID$(acut$
, start%
, dwidth
+ 1) start% = start% + dwidth + 1
x$
= MID$(acut$
, 1, dwidth
) start% = start% + dwidth
k%
= _INSTRREV(MID$(acut$
, 1, dwidth
), CHR$(32)) ' Include the space so word following is left justified on current line when word proceeding wraps to top line. start% = start% + k%
start% = start% + k%
filled% = filled% + 1
j% = row - 1 + scr + filled%
acut$
= MID$(acut$
, start%
) start% = 1
' Determine end of doc line.
IF row
+ scr
+ filled%
- 1 > noe
THEN noe = filled% + row + scr - 1
x$(0) = "" ' Precaution.
q% = 1 ' Display begins 1 line above row to handle any wrap changes.
wrap.on% = 0
RETURN ' ==================================================================
displaydoc:
' Routine to display doc arrays to page.
x$(i%) = ""
gg% = 0
IF gg%
> scr
+ row
AND row
+ scr
< noe
AND row
= page.h
THEN scr
= scr
+ 1:
GOSUB scrollscrn: row
= row
- 1:
LOCATE margin.t
+ row
, POS(0)
IF row
= 1 OR wrap.on%
= 0 THEN q%
= 0 ' Disable print line above.
k% = filled% + q% ' Number of altered lines to print to screen. If q% = 1 the line above the current row is also printed. Note that since the FOR loop starts at j% = 0, k% is actually one less than the number of lines altered in the wrap routine.
IF row
- q%
+ k%
>= page.h
THEN k%
= page.h
- (row
- q%
)
IF noe
- scr
< page.h
AND noe
>= page.h
THEN ' Adjust to bottom of the text screen. scr = noe - page.h
scr = scr + 1 ' Raises everything up one line below bottom line to allow for the blank line occupied by the cursor at column 1.
yy% = yy% + 1
row = 1: k% = page.h - 1: q% = 0
i% = row - q% + j% ' Display row.
LOCATE i%
+ margin.t
, margin.l
+ 1
IF h%
THEN ' Re-establish cursor position. yy%
= CSRLIN: xx%
= margin.l
+ border.thk
+ h%
MID$(a1$
, h%
, 1) = cur$
' NOTE: h% can be longer than len(a1$) when # is a space at end of full line of text. When this happens, QB64 will simply not include it in the shaorter a1$. MID$(x$
(scr
+ i%
), h%
, 1) = cur$: cur$
= ""
q% = 0
row
= CSRLIN - margin.t
' Needed here and in getkey for auto events.
'----------------------------------------------------------------------------------------------------------------------------
REM BKSP
CHR$(8) used at
end of doc requires this routine
to re
-position cursor at the
end of a wrapped upwards piece of text.
b$
= CHR$(0) + "u":
GOSUB getkeyauto: cur$
= ""'----------------------------------------------------------------------------------------------------------------------------
' Paragraph. variable is set to -1 for paragraphs.
GOSUB getkeyauto
' Make sure this routine always exits getkeyauto so it can return here after advancing cursor. Remember, non character keys don't exit that loop unless b$ = "". There is a kloop% condition to meet this gosub/return requirement.
curadvance% = 0
RETURN ' ==================================================================
' -------------------------------------------------------------------------
' NESTED GOSUBS
' -------------------------------------------------------------------------
markercalc:
o% = (row - 1) * dwidth2 + dwidth + 1
hlbypass% = 0
o1%
= (o%
- (o%
MOD dwidth2
)) / dwidth2
+ 1 ' Relative (margin independent) cursor row origin.d% = (row - 1) * dwidth2 + col ' Relative (margin independent) cursor destination marker.
o2%
= o%
MOD dwidth2
' Relative (margin independent) cursor column origin.d1% = row ' Relative (margin independent) cursor row destination. Note: row is also relative (margin independent).
d2% = col ' Relative (margin independent) cursor column destination. Note: col is also relative (margin independent).
scrollscrn: '
scrmov = scr - oldscr
mark% = mark% - scrmov * dwidth2
markrow% = markrow% - scrmov
d%
= (CSRLIN - margin.t
- 1 - scrmov
) * dwidth2
+ POS(0) - margin.l
mhl1% = mhl1% - scrmov * dwidth2
mhl1row% = mhl1row% - scrmov
j% = d1% - scrmov
IF cutdrow%
> scr
AND cutdrow%
<= page.h
+ scr
THEN ' On screen j% = cutdrow% - scr
d% = (j% - 1) * dwidth2 + cutdcol%
IF cutdrow%
< scr
THEN ' Above screen. d% = 1
mhl1row% = 0
a1$
= MID$(x$
(page.h
+ scr
), 1, INSTR(x$
(page.h
+ scr
), CHR$(10)) - 1) d%
= (page.h
- 1) * dwidth2
+ LEN(a1$
) d1%
= (d%
- (d%
MOD dwidth2
)) / dwidth2
+ 1 d2%
= d%
MOD dwidth2
' Relative (margin independent) cursor column origin. yy% = margin.t + d1%: xx% = margin.l + d2%
row = d1%: col = d2%
j% = 0
CASE IS < cutdrow%: j%
= cutmrow%: j1%
= cutmcol%
CASE IS = cutdrow%
' Highlighting begins and ends on same row. Ex: Left and right arrow keys. IF cutmcol%
< cutdcol%
THEN j%
= cutmrow%: j1%
= cutmcol%
ELSE j%
= cutdrow%: j1%
= cutdcol%
' Right arrow vs left arrow directions. CASE IS > cutdrow%: j%
= cutdrow%: j1%
= cutdcol%
jtop%
= cutmrow%: jbot%
= cutdrow%:
IF jtop%
> jbot%
THEN SWAP jtop%
, jbot%
IF h%
< 0 THEN j%
= -j%
' Preserve highlighted text while using scrollbar. j% = 0 ' For all non-mark% (highlighted) text line printing.
LOCATE margin.t
+ i%
, margin.l
+ 1 x1
= c1%: x2
= c2%: x3
= c1%: x4
= c2%: k%
= LEN(a2$
)
IF cutmrow%
= cutdrow%
THEN k%
= ABS(cutmcol%
- cutdcol%
) x3 = h1%: x4 = h2%
j1% = 1: x3 = h1%: x4 = h2%
j1% = 1: x3 = h1%: x4 = h2%
IF cutmrow%
< cutdrow%
THEN k%
= col
- 1 ELSE k%
= cutmcol%
- 1
IF cutmrow%
= cutdrow%
THEN ' Left/Right Highlighting on origination row. x3
= h1%: x4
= h2%: k%
= ABS(cutmcol%
- cutdcol%
) ELSE ' Left/Right/Up/Down Highlighting from row before scrolling row. x3 = h1%: x4 = h2%
j1% = 1: k% = col - 1
' Do nothing. Arrow left and up do not require any change in parameters here.
IF i%
+ scr
> jtop%
AND i%
+ scr
< jbot%
THEN j1% = 1: x3 = h1%: x4 = h2%
x3 = h1%: x4 = h2%
j1% = 1: k% = cutmcol% - 1
k%
= ABS(cutmcol%
- cutdcol%
) ' Do nothing.
x3 = h1%: x4 = h2%
j1% = 1: k% = cutdcol% - 1
oldscr = scr
wipescrn:
LOCATE i%
+ margin.t
, margin.l
+ 1
hlwipescrn:
a1$ = x$(j% + scr)
LOCATE margin.t
+ j%
, margin.l
+ 1
clearmarkers:
' Clear most variables used in highlighting process. Some others are non-essential to conditions.
mark% = 0: o% = 0: mhl% = 0: mhl1% = 0: mhl1col% = 0: mhl1row% = 0: mhlclear% = 0: cutdrow% = 0
cutmrow% = 0: o1% = 0: o2% = 0: d% = 0: d1% = 0: d2% = 0: dmodify% = 0
markrow% = 0: markcol% = 0: cutmcol% = 0: cutdcol% = 0
betatest:
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
' LARGEST GOSUB ROUTINE
getkey:
DEF SEG = 0 ' Look for Shift key press.
' Mouse clicks can influence b$ outside of the keypress loop. That's why b$ = "" in some keypress routines when they are completed.
locked% = 0 ' A key press removes all mouse and mouse wheel locks.
autokey% = 0
IF LEN(autokey$
) THEN b$
= autokey$: autokey$
= ""
null$
= INKEY$: b$
= "" ' Clear key buffer when left mouse button is held down and lock out keys.
autokey% = -99: autokey$ = b$
CASE CHR$(0) + "w" ' Ctrl + Shift + Home ' Required hold variables.
hold1%
= row: hold2%
= scr: hold3%
= POS(0) - margin.l
markbypass%
= -1:
GOSUB getkeyauto: markbypass%
= 0
j%
= cutmrow%
- scr: k%
= cutdrow%
- scr:
IF k%
> page.h
THEN k%
= page.h
a1$ = x$(i% + scr)
LOCATE margin.t
+ i%
, margin.l
+ 1 mark% = (cutmrow% - 1) * dwidth2 + cutmcol% - 1 ' Note the -1 is here to "flip" to the other side of the highlighted line and not overlap.
markrow%
= (mark%
- (mark%
MOD dwidth2
)) / dwidth2
+ 1 markcol%
= mark%
MOD dwidth2
mark% = (cutmrow% - 1) * dwidth2 + cutmcol%
markrow% = cutmrow%: markcol% = cutmcol% - 1 ' - 1 required to avoid overlap.
IF mark%
= 0 THEN ' Shift + Ctrl + Home resulted in clearing all text when all text was previously highlighted. Ex: Shift + Ctrl + A followed by Shift + Ctrl + HOme. cutdrow% = 1: cutdcol% = 1
col = 1 ' Required.
b$ = ""
mark% = (hold1% + hold2% - 1) * dwidth2 + hold3%: markrow% = hold1% + hold2%: markcol% = hold3%
cutmrow% = hold1% + hold2%: cutmcol% = markcol%
cutdrow% = 1: cutdcol% = 1: col = 1
row
= 1: scr
= 0:
LOCATE margin.t
+ row
, margin.l
+ 1
j%
= page.h: k%
= 1: g%
= 0:
IF j%
>= cutmrow%
THEN j%
= cutmrow%: g%
= 1 FOR i%
= 0 TO j%
- 1 - g%
LOCATE margin.t
+ 1 + i%
, margin.l
+ 1 LOCATE margin.t
+ 1 + i%
, margin.l
+ 1 LOCATE margin.t
+ 1, margin.l
+ 1 b$ = ""
hold1%
= row: hold2%
= scr: hold3%
= POS(0) - margin.l
holdcutmrow% = cutmrow%: holdcutmcol% = cutmcol%: holdcutdrow% = cutdrow%: holdcutdcol% = cutdcol%
markbypass%
= -1:
GOSUB getkeyauto: markbypass%
= 0
IF cutmrow%
> cutdrow%
THEN ' Highlighting was from bottom up. hold1% = cutmrow% - scr: hold2% = scr: hold3% = cutmcol%
ELSE ' Highlighting continuing from top down. mark% = (cutmrow% - 1) * dwidth2 + cutmcol%
markrow% = cutmrow%
cutdrow%
= row
+ scr: cutdcol%
= POS(0) - margin.l
hold1% = cutmrow% - hold2% ' orig scr. hold1% is now row.
hold3% = cutmcol%
mark% = (hold1% + hold2% - 1) * dwidth2 + hold3%: markrow% = hold1% + hold2%: markcol% = hold3%
cutmrow% = hold1% + hold2%: cutmcol% = markcol%
cutdrow%
= noe: cutdcol%
= LEN(MID$(x$
(noe
), 1, INSTR(x$
(noe
), CHR$(10)) - 1)) + 1
yy%
= CSRLIN: xx%
= POS(0): col
= xx%
- margin.l
IF noe
- cutmrow%
< page.h
THEN j% = page.h - (cutmrow% - scr)
k% = cutmrow% - scr
j% = page.h - 1: k% = 1: hold1% = 1: hold2% = scr: hold3% = 1
IF noe
< page.h
THEN j%
= noe
- hold1%
LOCATE margin.t
+ k%
, margin.l
+ hold3%
a1$
= MID$(x$
(hold1%
+ hold2%
), 1, INSTR(x$
(hold1%
+ hold2%
), CHR$(10)) - 1) LOCATE margin.t
+ k%
+ i%
, margin.l
+ 1
IF mark%
<> 0 AND hold1%
= row
AND cutmrow%
= holdcutmrow%
AND cutmcol%
= holdcutmcol%
AND cutdrow%
= holdcutdrow%
AND cutdcol%
= holdcutdcol%
THEN
b$ = ""
mark% = dwidth2 * -scr + 1: markrow% = -scr + 1: markcol% = 1
cutmrow% = 1: cutmcol% = 1
cutdrow%
= noe: cutdcol%
= LEN(MID$(x$
(noe
), 1, INSTR(x$
(noe
), CHR$(10)) - 1)) + 1 col = xx% - margin.l
LOCATE margin.t
+ 1, margin.l
+ 1 j% = page.h: k% = scr + 1
LOCATE margin.t
+ 1 + i%
, margin.l
+ 1 b$ = ""
IF cutmrow%
= cutdrow%
THEN ' Same line delete. updatescrn% = 1
ELSE ' Multiple line delete. b$ = ""
' NOTE: col is not defined in these wp routines but is when scrollscrn is called.
scr
= scr
- 1: h%
= 0:
GOSUB scrollscrn: row
= row
+ 1 LOCATE margin.t
+ row
, margin.l
+ col
scr
= scr
+ 1: h%
= 0:
GOSUB scrollscrn: row
= row
- 1 LOCATE margin.t
+ row
, margin.l
+ col
i1% = cutmrow%: j1% = cutmcol%
i2% = cutdrow%: j2% = cutdcol%
IF cutdrow%
< cutmrow%
OR cutdrow%
= cutmrow%
AND cutdcol%
< cutmcol%
THEN SWAP i1%
, i2%:
SWAP j1%
, j2%
i1%
= row
+ scr: j1%
= POS(0) - margin.l
i2%
= row
+ scr: j2%
= POS(0) - margin.l
a2$
= MID$(a1$
, 1, j1%
- 1) cur$ = "eod"
row = row - 1
a$ = a1$ + a2$ + myCLIPBOARD$ + a3$
a$ = a2$ + myCLIPBOARD$ + a3$
x$(i%) = ""
x$(i1%) = ""
wrap.on%
= -1:
GOSUB wrapper
scr = noe - page.h
row = 1
scr = i% - page.h + 1
row = 1
LOCATE row
+ margin.t
, margin.l
+ 1 filled%
= page.h:
GOSUB displaydoc
b$ = ""
' Left mouse button down or Shift key down with a highlighting key pressed.
mark% = (row - 1) * dwidth2 + col: markrow% = row: markcol% = col ' Highlight cursor position markers.
IF cutmrow%
= 0 THEN cutmrow%
= markrow%
+ scr: cutmcol%
= markcol%
' Marks the entry row and column position for all the cummulative highlighted text and allows this text to be preserved when scrolling. ' Disable highlight key when active and a key is pressed without Shift key held or
b$ = ""
IF mark%
AND LEN(b$
) > 0 THEN ' Highlighted text and key press. Note: Left mouse click to clear text is in another routine. IF b$
<> CHR$(3) AND b$
<> CHR$(22) AND b$
<> CHR$(24) THEN GOSUB hlwipescrn
' Use this or some other routine to clear the highlighted text off the screen.
IF mhl%
AND locked%
<> 2 THEN ' Left mouse button click or held highlighting. ' Lateral movement. Do nothing. Action is taken in the select case mov routine.
ELSE ' Simulate an up or down arrow key routines for mouse highlighting when changing rows.
keylogger$ = keylogger$ + z$: z$ = ""
IF row
= 1 AND scr
> 0 THEN ' Scroll screen down so cursor is on row 2 instead of 1. scr
= scr
- 1:
GOSUB scrollscrn: row
= row
+ 1:
LOCATE margin.t
+ row
, POS(0)
IF row
= page.h
AND row
+ scr
< noe
THEN ' Scroll screen up so cursor is on row above last row. scr
= scr
+ 1:
GOSUB scrollscrn: row
= row
- 1:
LOCATE margin.t
+ row
, POS(0)
getkeyauto:
row
= CSRLIN - margin.t
' Needed here for auto cursor up / down changes. Also needed at display routine where wrap can make row changes if a word above is wrapped down when backspacing. kloop% = 0
' Determine cursor boundaries at end of a text line. --------------
n% = dwidth + ovm%
ELSE ' All within margin length situations. IF row
+ scr
< noe
THEN ' Rows above last line.
n% = n% + margin.l
' --------------------------------------------------------------------
autobkspdel% = 0
autodelforward% = 0
reloop% = 0
IF mhl%
AND locked%
<> 2 THEN ' Left mouse key highlighting.
IF row
= mhl1row%
THEN ' Detect when the row in the loop matches the row marked to terminate the loop. SELECT CASE mhl1col%
' Now that the loop has terminated at the marked row, find the marked column. CASE 999 ' Column at loop exit is already at the marked column. CASE ELSE ' Set col variable to mouse column marker and zero out that marker along with the simulated key press. ' New col position allows highlighter routine to highlight text on this row to this column.
col
= mhl1col%:
LOCATE , margin.l
+ col
mhl1col% = 999 ' 0
b$
= CHR$(0) + CHR$(0): kloop%
= 0 ' Important. Must nullify variable to avoid case selection below.
SELECT CASE MID$(b$
, 2, 1) ' Cursor movement routine. May be replace or incorporated into outer cursor movement routines. k% = page.h - 1 ' The number of lines scrolled up. Ex: in a 9-line doc, scroll up 16 lines.
cutdrow% = row + scr - k%: cutdcol% = 1 ' No need for a reverse condition. Page Up treats them the same. For ref cutmrow% > cutdrow% is forward.
scr = scr - k%
LOCATE margin.t
+ 1, margin.l
+ 1 a1$ = x$(i% + scr)
LOCATE margin.t
+ i%
, margin.l
+ 1 LOCATE margin.t
+ row
, margin.l
+ 1 b$ = ""
k% = (page.h - 1) * 2 ' The number of lines scrolled down. Ex: in a 9-line doc, scroll down 16 lines.
IF k%
+ scr
> noe
THEN k%
= noe
- scr
- 1
IF cutmrow%
< cutdrow%
OR cutdrow%
= 0 THEN cutdrow%
= row
+ scr
+ k%
- page.h: cutdcol%
= LEN(MID$(x$
(row
+ scr
+ k%
- page.h
), 1, INSTR(x$
(row
+ scr
+ k%
- page.h
), CHR$(10)) - 1)) ELSE ' Reverse on previously highlighted text. cutdrow% = row + scr + k% - page.h + 1: cutdcol% = 1
scr = scr + k% - page.h + 1
LOCATE margin.t
+ 1, margin.l
+ 1
a1$ = x$(i% + scr)
LOCATE margin.t
+ i%
, margin.l
+ 1
hold1%
= row: row
= CSRLIN - margin.t
LOCATE margin.t
+ row
, margin.l
+ 1 row = hold1%: col = 1
ELSE ' Doc too small to page down. b$ = ""
row = row - 1
row = row + 1: scr = scr - 1
row = 1
IF row
+ scr
< noe
THEN row
= row
+ 1 row = row - 1: scr = scr + 1
h%
= page.h
- 1:
GOSUB scrollscrn
row = page.h
col = col + 1
IF row
+ scr
< noe
THEN row
= row
+ 1: col
= 1 row = row - 1: scr = scr + 1
h%
= page.h
- 1:
GOSUB scrollscrn
row = page.h: col = 1
LOCATE margin.t
+ row
, margin.l
+ col
col = col - 1
row = row - 1
col
= LEN(a1$
):
IF col
< dwidth
- 1 THEN col
= col
+ 1 row = row + 1: scr = scr - 1
row
= 1: a1$
= MID$(x$
(row
+ scr
), 1, INSTR(x$
(row
+ scr
), CHR$(10)) - 1) col
= LEN(a1$
):
IF col
< dwidth
- 1 THEN col
= col
+ 1 col = 1
col
= LEN(a1$
):
IF col
< dwidth
- 1 THEN col
= col
+ 1 c_s_travel% = 0: c_s_tracker% = 0
a1$
= MID$(x$
(row
+ scr
), k%
, 1) g% = -1 'find the first space after any solid character.
g% = 2
g% = 1
c_s_tracker% = c_s_tracker% + 1
IF c_s_travel%
THEN c_s_tracker%
= c_s_tracker%
+ 1 c_s_travel% = c_s_travel% + 1
col
= POS(0) - margin.l: a1$
= MID$(x$
(row
+ scr
), 1, INSTR(x$
(row
+ scr
), CHR$(10)) - 1) FOR c_s_index%
= 1 TO c_s_travel%
- 1 col = col - 1
row = row - 1
row = row + 1: scr = scr - 1
row = 1
LOCATE margin.t
+ row
, margin.l
+ col
c_s_travel% = 0: c_s_tracker% = 0
a1$
= MID$(x$
(row
+ scr
), k%
, 1) FOR i%
= row
+ scr
TO noe
c_s_tracker% = c_s_tracker% + 1
c_s_tracker% = c_s_tracker% + 1
c_s_travel% = c_s_travel% + 1
k% = 1
FOR c_s_index%
= 1 TO c_s_travel%
col
= POS(0) - margin.l: a1$
= MID$(x$
(row
+ scr
), 1, INSTR(x$
(row
+ scr
), CHR$(10)) - 1)
col = col + 1
row = row + 1: col = 1
row = row - 1: scr = scr + 1
h%
= page.h
- 1:
GOSUB scrollscrn
row = page.h: col = 1
LOCATE margin.t
+ row
, margin.l
+ col
LOCATE margin.t
+ row
, margin.l
+ col
IF mark%
THEN GOSUB highlighter
' Cursor may need to advance after mark% is zeroed in highlighter routine.
LOCATE margin.t
+ row
, margin.l
+ col
' Note: Both row and col variables are relative and must be added to any left or top margin variables to appear in the proper row and column positions on the screen.
hold1%
= row:
GOSUB markercalc: h%
= 0:
GOSUB scrollscrn
row = hold1%: col = 1
LOCATE margin.t
+ row
, margin.l
+ col
GOSUB movescrollbox
' Required. Scrollscrn polls this but the cursor gets repositioned, after that call, in line above.
IF col
< dwidth
- 1 THEN col
= col
+ 1 LOCATE margin.t
+ row
, margin.l
+ col
' Note: Both row and col variables are relative and must be added to any left or top margin variables to appear in the proper row and column positions on the screen.
updatescrn% = 1
k%
= POS(0) - (margin.l
+ border.thk
) ' There is a space in the margin, so leave that space and push the paragraph symbol to the line below.
' wrapper is engaged by text line instr() analysis, later.
curadvance% = -1
b$ = "exit"
row = row - 1
scr
= scr
- 1: h%
= 0:
GOSUB scrollscrn
row = row + 1
scr = scr + 1
noe = noe + 1
scr
= scr
+ 1: h%
= 0:
GOSUB scrollscrn
row = row + 1
LOCATE margin.t
+ row
, margin.l
+ 1 c_s_travel% = 0: c_s_tracker% = 0
a1$
= MID$(x$
(row
+ scr
), k%
, 1) g% = -1 'find the first space after any solid character.
g% = 2
g% = 1
c_s_tracker% = c_s_tracker% + 1
IF c_s_travel%
THEN c_s_tracker%
= c_s_tracker%
+ 1 c_s_travel% = c_s_travel% + 1
FOR c_s_index%
= 1 TO c_s_travel%
- 1: autokey
= -1: b$
= CHR$(0) + "K":
GOSUB getkeyauto:
NEXT c_s_travel% = 0: c_s_tracker% = 0
a1$
= MID$(x$
(row
+ scr
), k%
, 1) FOR i%
= row
+ scr
TO noe
c_s_tracker% = c_s_tracker% + 1
c_s_tracker% = c_s_tracker% + 1
c_s_travel% = c_s_travel% + 1
k% = 1
FOR c_s_index%
= 1 TO c_s_travel%: autokey
= -1: b$
= CHR$(0) + "M":
GOSUB getkeyauto:
NEXT ' Do nothing.
k% = page.h - 1 + row - 2
k% = (page.h - 1) + (page.h - row) - 1
FOR j%
= 1 TO page.h
- row
CASE CHR$(0) + "G" ' Cursor home on current line. CASE CHR$(0) + "O" ' Cursor end on current line. IF kloop%
= 0 THEN ' User key press. LOCATE , n%
+ 1 ' Allows more text to be added to the line in front of the last character. ELSE ' Automated cursor advance. For these routines, the cursor never goes past last character. row = 1
scr = 0
LOCATE margin.t
+ 1, margin.l
+ 1 row = page.h
scr = noe - row
LOCATE margin.t
+ 1, margin.l
+ 1 LOCATE margin.t
+ page.h
, margin.l
+ dwidth
row = noe
LOCATE margin.t
+ row
, margin.l
+ dwidth
updatescrn% = 1
b$
= "**" + CHR$(0) + "G" + CHR$(0) + "P": autodelforward%
= -1 ELSE ' delete the character under the cursor. a$
= MID$(a$
, 1, POS(0) - margin.l
- 1) + MID$(a$
, POS(0) - margin.l
+ 1) ' Take no action. blank doc.
ELSE ' Delete character from current cursor position. IF row
+ scr
< noe
THEN ' The furthest right character on the line was deleted, and now the cursor must be positioned at the start of the next line, otherwise cur$ would be null. '1 of 2 places CUR$ replacement is set. >>>
cur$
= LEFT$(x$
(row
+ scr
+ 1), 1):
MID$(x$
(row
+ scr
+ 1), 1, 1) = CHR$(4) cur$ = "eod"
' Do nothing. Single line no wrap possible.
ELSE ' character deleted was at or between the first and next to the last character on the line. ' First character of doc. Do not delete using backspace.
b$
= "**" + CHR$(0) + "K": autobkspdel%
= -1 updatescrn% = 1
k% = j% - (margin.l + border.thk)
' 1 of 2 places CUR$ replacement is set. >>>
cur$ = b$
MID$(a$
, k%
, 1) = CHR$(4) ' Display occurs in FOR/NEXT print to screen routine. x$
(row
+ scr
+ 1) = MID$(x$
(row
+ scr
+ 1), 2) curadvance% = 1: b$ = "exit"
cur$ = b$
curadvance% = 1: b$ = "exit"
IF POS(0) - (margin.l
+ border.thk
) < dwidth
+ 1 THEN b$ = "exit"
scr = scr + 1
row = row + 1
LOCATE margin.t
+ row
, margin.l
+ 1 b$ = "exit"
b$ = "exit-partial"
kloop% = kloop% + 2
IF kloop%
> 4 AND curadvance%
THEN b$
= "exit":
EXIT DO ' Allow a coming return back to the curadvance gosub getkeyauto line.
END IF ' mark% vs non-mark%
IF b$
= "exit-partial" THEN b$
= ""
' Audit Mouse Routines ====================================================
mb.w = 0
IF locked%
< 0 THEN ' Mouse effects on mouse lock. key press effects are determined at inkey$ input, as key variable cannot be evaluated here, due to b$ = "" manipulations in the keypress routine.
IF mb.w
THEN ' Determine if wheel is being used to scroll highlighted or unhighlighted text. locked% = -1
mhl1row% = row: mhl1col% = col: mhl1% = (row - 1) * dwidth2 + col
locked% = 2 ' 2 is lock scrollbar, no highlighting permitted.
' Scrollbar routine.
IF mx%
>= scrb.l
- 1 AND mx%
<= scrb.l
+ 1 AND my%
- (scrb.t
+ 1) >= scrb.x
AND my%
- (scrb.t
+ 1) <= scrb.x
+ scrb.s
- 1 THEN draglock%
= -1 IF draglock%
= -1 AND my%
> scrb.t
AND my%
< scrb.b
OR mx%
= scrb.l
AND scrb.s
<> 0 AND my%
>= scrb.t
AND my%
<= scrb.b
AND mb.w
= 0 OR scrbardrag%
<> 0 AND my%
> scrb.t
AND my%
< scrb.b
AND mb.w
= 0 OR mb.w
> 0 AND scrb.x
+ scrb.s
< scrb.h
OR mb.w
< 0 AND scrb.x
> 0 THEN ' Mouse on scrollbar, doing a bar cursor drag or using the scroll wheel. locked% = 2 ' Locked on scrollbar
IF my%
= scrb.t
AND scrb.x
> 0 OR my%
= scrb.b
AND scrb.x
+ scrb.s
< scrb.h
OR mb.w
<> 0 THEN ' Mouse on a scrollbar arrow. IF my%
= scrb.t
AND mb.w
= 0 OR mb.w
< 0 THEN scrb.x
= scrb.x
- 1: h%
= -1 ELSE scrb.x
= scrb.x
+ 1: h%
= -2 ' Top or bottom arrow. j%
= INT(scrb.x
* ((noe
- scrb.d
) / (scrb.h
- scrb.s
)))
IF j%
>= 0 THEN ' Condition exists unless j% is negative such as doc is blank and mouse wheel is rolled downward. scrb.i = j%
IF mark%
= 0 THEN h%
= 0 ' h% was assigned a few lines up but gets zeroed here if there is no highlighting.
scr = scrb.i
GOSUB makescrb
' Positions scrollbar box.
ELSEIF my%
- (scrb.t
+ 1) >= scrb.x
AND my%
- (scrb.t
+ 1) <= scrb.x
+ scrb.s
- 1 AND scrbardrag%
= 0 THEN ' Mouse on scrollbar block. scrbardrag% = -1: scrb.adjust = (my% - (scrb.t + 1)) - scrb.x
ELSEIF draglock%
= -1 AND my%
> scrb.t
AND my%
< scrb.b
OR my%
> scrb.t
AND my%
< scrb.b
THEN ' Mouse on scrollbar between scrollbar arrow and cursor. IF draglock%
= -1 AND my%
> scrb.t
AND my%
< scrb.b
OR my%
- (scrb.t
+ 1) - scrb.adjust
>= 0 AND my%
- (scrb.t
+ 1) + scrb.s
- scrb.adjust
<= scrb.h
AND scrbardrag%
<> -1 OR scrbardrag%
= 0 THEN IF scrbardrag%
= 0 THEN ' No drag, so adjust for cursor length for a click inside the scrollbar above or below the current scrollbar cursor position. IF my%
- (scrb.t
+ 1) > scrb.x
THEN scrb.adjust = (my% - (scrb.t + 1)) - scrb.x - 1: h% = -1
scrb.adjust = (my% - (scrb.t + 1)) - scrb.x + 1: h% = -2
scrb.x = my% - (scrb.t + 1) - scrb.adjust
scrb.i
= INT(scrb.x
* ((noe
- scrb.d
) / (scrb.h
- scrb.s
)))
IF mark%
= 0 THEN h%
= 0 ' h% was assigned a few lines up but gets zeroed here if there is no highlighting.
scr = scrb.i
ELSE ' Scrollbar is at top or bottom and mouse cursor is moving vertically along the scrollbar cursor. This allows the variable to readjust. IF mx%
= scrb.l
THEN scrbardrag%
= 0: scrb.adjust
= 0: draglock%
= 0 ' =======================================================
IF scr
< cursor.top
OR scr
> cursor.bot
THEN IF row
+ scr
<> cursor.scbrrow
AND cursor.scbrrow
<> 0 THEN row = cursor.scbrrow - scr
delay.
on!
= 0 ' Toggle off.
scrbardrag% = 0: scrb.adjust = 0: draglock% = 0
IF mb.w
AND locked%
= -1 THEN ' shift key down. Mouse wheel highlighting. autokey% = -1 ' Note: Gosub getkeyauto will not work here.
IF mx%
> margin.l
AND mx%
<= margin.l
+ dwidth
+ 1 AND my%
>= margin.t
+ 1 AND my%
<= margin.t
+ page.h
OR mark%
<> 0 AND locked%
= 1 OR mark%
<> 0 AND locked%
= 3 THEN ' Cursor in-bounds. IF curhide%
THEN curhide%
= 0: row
= my%
- margin.t: col
= mx%
- margin.l:
LOCATE margin.t
+ row
, margin.l
+ col
, 1:
EXIT DO j% = 0: ii2% = my% - margin.t
ii2% = 1
j% = -1
locked% = 3
ii2% = noe
j% = 1
locked% = 3
ii2% = page.h
j% = 1
locked% = 3
a1$
= MID$(x$
(ii2%
+ scr
), 1, INSTR(x$
(ii2%
+ scr
), CHR$(10)) - 1)
mxalt% = mx%
IF mx%
< margin.l
+ 1 THEN mxalt%
= margin.l
+ 1 mxalt%
= margin.l
+ LEN(a1$
) + 1 IF mxalt%
- margin.l
> dwidth
+ 1 THEN mxalt%
= margin.l
+ dwidth
+ 1 mxalt% = margin.l + 1
IF mx%
- margin.l
> LEN(a1$
) THEN maxalt%
= margin.l
+ LEN(a1$
) - 1
IF my%
> margin.t
+ page.h
OR my%
< margin.t
+ 1 THEN col = mxalt% - margin.l
LOCATE margin.t
+ ii2%
, margin.l
+ col
row = row + 1: scr = scr - 1
col = mxalt% - margin.l
LOCATE margin.t
+ ii2%
, margin.l
+ col
row = row - 1: scr = scr + 1
h%
= page.h
- 1:
GOSUB scrollscrn
IF mhlclear%
THEN ' Check to see if highlighting should be removed. IF shift%
THEN ' Do not remove highlighted text. mhlclear% = 0
GOSUB hlwipescrn
' Remove highlighted text.
IF shift%
OR (ii2%
- 1) * dwidth2
+ mxalt%
- margin.l
<> mhl1%
AND mhl1%
<> 0 THEN mhl% = -1 ' Left mouse key highlighting enabled when Shift key held and left mouse button click or when Shift held or not held if left mouse button is held while changing row/column (drag).
locked% = 1
mhl1row% = ii2%: mhl1col% = mxalt% - margin.l: mhl1% = (ii2% - 1) * dwidth2 + mxalt% - margin.l
IF mhl1%
<> (ii2%
- 1) * dwidth2
+ mxalt%
- margin.l
THEN mhl1% = (ii2% - 1) * dwidth2 + mxalt% - margin.l
row = ii2%: col = mxalt% - margin.l
LOCATE margin.t
+ row
, margin.l
+ col
mhl1% = 0 ' Left mouse button not engaged so zero the highlighting marker.
IF locked%
AND mb.w
= 0 THEN locked%
= 0 ' Undo mouse lock unless mouse wheel is in current use. IF mark%
THEN mhlclear%
= -1 ' Will be triggered the next time the left mouse button is pressed to remove all highlighted text. LOOP ' Mouse loop terminates here.
IF noe
< row
+ scr
THEN noe
= row
+ scr
RETURN ' ==================================================================
'==========================================================================
' NOTES
INSTR(x$
(c%
), CHR$(10)) > 1 Indicates an array with text.
INSTR(x$
(row
+ scr
), CHR$(10)) <= 1 Indicates an array without text.
Value
= 0:
(Valid
) Array
is empty with no EOL.
Value
= 1:
(Invalid
) Array
is empty but has a EOL added. This should
not be present
, but I think it occurs when a
line is initially erased. This needs more investigation.
Value > 1: (Valid) Array contains text.
'==========================================================================
getvar_setscrn:
scrb.x = 0 ' Relative position of the scrollbar cursor from top of scrb.h. 0 Off / 1 to
page.w = scrn.w - (margin.l + margin.r)
page.h = scrn.h - (margin.t + margin.b)
scrb.t = margin.t + 1
scrb.b = margin.t + page.h
scrb.l = margin.l + page.w + 2
page.w = scrn.w - (margin.l + margin.r)
page.h = scrn.h - (margin.t + margin.b)
scrb.d = scrb.b - scrb.t + 1
scrb.h = scrb.b - scrb.t - 1 ' Max. vertical scroll. Bar minus the top and bottom arrow symbols.
a$ = "": row = 1: scr = 0
wrap.on%
= -1:
GOSUB wrapper
noe = filled%: filled% = 0
LOCATE margin.t
+ 1, margin.l
+ 1, 1, 7, ins%
row
= CSRLIN - margin.t: scr
= 0filled% = noe
scrb.s = 0 ' No scroll box required.
scrb.s
= (scrb.h
+ 1) * 2 - noe:
IF scrb.s
<= 0 THEN scrb.s
= 1 scrb.s = 1
IF page.c
= 0 THEN page.c
= 7 ' Cursor apearance as underline.
LOCATE margin.t
+ row
, margin.l
+ 1, 1, 7, page.c
movescrollbox:
scrb.s = 0 ' No scroll box required.
RETURN ' Required to prevent unhandled conditions in scrollbar box movement. scrb.s
= (scrb.h
+ 1) * 2 - noe:
IF scrb.s
<= 0 THEN scrb.s
= 1 scrb.s = 1
scrb.x = 0
IF scrb.x
< page.h
- 3 AND row
+ scr
>= INT((scrb.x
+ 1) * ((noe
- scrb.d
) / (scrb.h
- scrb.s
))) + page.h
THEN scrb.x = 0
DO UNTIL scrb.x
= scrb.h
- scrb.s
OR page.h
+ scr
< INT((scrb.x
+ 1) * ((noe
- scrb.d
) / (scrb.h
- scrb.s
))) + page.h
scrb.x = scrb.x + 1
scrb.x = page.h - 3
DO UNTIL page.h
+ scr
> INT((scrb.x
+ 1 - 2) * ((noe
- scrb.d
) / (scrb.h
- scrb.s
))) + page.h
scrb.x = scrb.x - 1
IF scrb.x
+ scrb.s
> scrb.h
THEN ' Scrollbox expansion adjustment. scrb.x = scrb.h - scrb.s
scrb.i
= INT(scrb.x
* ((noe
- scrb.d
) / (scrb.h
- scrb.s
)))
makescrb:
LOCATE scrb.t
+ scrb.x
+ i%
, scrb.l
getcurinfo:
cursor.scbrrow = row + scr
cursor.scbrcol
= POS(0) - margin.l
cursor.holdscr = scr
cursor.holdrow = row
cursor.top = scr - page.h + row
cursor.bot = scr + row - 1
cursor.holdscrbx = scrb.x
backtocursor:
scr = cursor.holdscr
row = 1
LOCATE margin.t
+ row
, margin.l
+ 1 filled%
= page.h:
GOSUB displaydoc
row = cursor.holdrow
col = cursor.scbrcol
scrb.x = cursor.holdscrbx
scrb.i = scr
curhide% = 0
LOCATE margin.t
+ row
, margin.l
+ col
, 1
highlighter:
cutdrow% = row + scr: cutdcol% = col ' Also found in scrollscrn routine.
o% = mark%
o% = d% ' o% is the start marker or last marker. If zero, it is the same as the start marker (mark%) but if the highlighting process is ongoing, it is the same as the last highlighting marker (d%).
hlbypass%
= -1:
GOSUB markercalc
' o% has already been set. hlbypass% gets zeroed in gosub statement.
IF d%
>= o%
THEN mov%
= 1 ELSE mov%
= -1:
' Difference between origin and destination markers determine if the movement is positive (right, down) or negative (left, up).
CASE 1 ' End, right, or down x1%
= o1%: x2%
= o2%:
LOCATE margin.t
+ x1%
, margin.l
+ x2%
' Highlighting on line above, from origin row.
IF x1%
= markrow%
AND o1%
= d1%
AND mhl%
THEN ' Mouse only when the origin row is the same as the original marker row and the destination row is the same as the origin row. This is right movement within the same line of text. ELSEIF x1%
= markrow%
AND ABS(o%
- d%
) > 1 THEN ' End key press. Exclude mouse here, as down mouse highlighting is done in a conditional statement, below. GOSUB getcolor:
PRINT MID$(a1$
, x2%
, ABS(o2%
- markcol%
));
' Print from origin column to initial marker column. GOSUB getcolor:
PRINT MID$(a1$
, x2%
+ ABS(o2%
- markcol%
));
' Print from initial marker column to destination column. ELSE ' Right arrow key, down arrow key or mouse moving down. GOSUB getcolor:
PRINT MID$(a1$
, x2%
, ABS(o1%
- d1%
) * dwidth2
+ ABS(o2%
- d2%
));
' Trick method to determine length of highlighting.
IF o1%
- d1%
THEN ' Highlighting on current row after row above is finished. x1%
= row: x2%
= col:
LOCATE margin.t
+ x1%
, margin.l
+ 1 IF x1%
= markrow%
AND ABS(o%
- d%
) > 1 THEN ' Highlight the destination row if downward move is made after an upward highlight has been made. IF d2%
< markcol%
THEN i%
= d2%
ELSE i%
= markcol%
' Set i% to the furthest column. GOSUB getcolor:
PRINT MID$(a1$
, 1, i%
- 1);
' unhighlight to the furthest column. ELSE ' Arrow down or mouse downward, either with original marker row on same line. GOSUB getcolor:
PRINT MID$(a1$
, 1, d2%
- 1);
' Highlight from first column on current row to destination on current row.
CASE -1 ' Home, up, or Left. x1%
= row: x2%
= col:
LOCATE margin.t
+ x1%
, margin.l
+ x2%
IF x1%
= markrow%
AND o1%
= d1%
AND mhl%
THEN ' Mouse only when the origin row is the same as the original marker row and the destination row is the same as the origin row. This is left movement within the same line of text. ELSEIF x1%
= markrow%
AND ABS(o1%
- d1%
) >= 1 THEN ' Mouse or arrow back up to highlighted line above. GOSUB getcolor:
PRINT MID$(a1$
, x2%
, ABS(d2%
- markcol%
));
' Highlight from cursor to previously highlighted text to the right, if any. GOSUB getcolor:
PRINT MID$(a1$
, x2%
+ ABS(d2%
- markcol%
));
' Unhighlight previous text to the right. ELSE ' Arrow left, home, arrow up or mouse upwards, either without any highlighting above. GOSUB getcolor:
PRINT MID$(a1$
, x2%
, ABS(o1%
- d1%
) * dwidth2
+ ABS(o2%
- d2%
));
' Trick method to determine length of highlighting.
IF o1%
<> d1%
AND d2%
<= o2%
THEN ' Bottom line with arrow up or mouse upwards. Note: Mouse initially moves straight up, and moves laterally in another pass. This is why o2% always equals d2% as with an arrow up move. x1%
= o1%: x2%
= o2%:
LOCATE margin.t
+ x1%
, margin.l
+ 1
IF markcol%
>= d2%
THEN i%
= d2%
ELSE i%
= markcol%
IF x1%
= page.h
AND dmodify%
THEN d2%
= d2%
+ dmodify%
dmodify% = 0
getcolor: ' Reads the screen under the cursor and reverses the colors.
IF POS(0) - margin.l
> dwidth
+ 1 THEN ' Cursor in scrollbar space after full line of text was printed.
copytext:
i1% = cutmrow%: i2% = cutdrow%
j% = cutmcol%: k% = cutdcol%
myCLIPBOARD$
= MID$(x$
(i1%
), j%
, k%
- j%
) myCLIPBOARD$ = a1$
FOR i%
= 1 TO i2%
- i1%
- 1 myCLIPBOARD$ = myCLIPBOARD$ + a1$
a1$
= MID$(x$
(i2%
), 1, k%
- 1) myCLIPBOARD$ = myCLIPBOARD$ + a1$
singlelinedelete:
IF cutmcol%
< cutdcol%
THEN j%
= cutmcol%: k%
= cutdcol%
ELSE j%
= cutdcol%: k%
= cutmcol%
a2$
= MID$(a1$
, 1, j%
- 1) cur$ = "eod"
a$ = a2$ + a3$
multilinedelete:
i1% = cutmrow%: i2% = cutdrow%
j% = cutmcol%: k% = cutdcol%
IF i1%
> i2%
THEN SWAP i1%
, i2%:
SWAP j%
, k%
' Highlighting was upwards instead of downwards.
oldrow = row: oldscr = scr
a2$
= MID$(x$
(i1%
), 1, j%
- 1)b$ = ""
cur$
= MID$(x$
(i2%
+ 1), 1, 1):
MID$(x$
(i2%
+ 1), 1, 1) = CHR$(4) cur$ = "eod"
a$ = a2$ + a3$
i1% = i1% - 1
a$ = a1$ + a$
x$(i%) = ""
row = 1: scr = i1% - row
a1$ = "": a2$ = "": a3$ = ""
wrap.on%
= -1:
GOSUB wrapper
LOCATE row
+ margin.t
, margin.l
+ 1
IF scr
> 0 THEN ' Adjust towards bottom of screen. scr = noe - page.h - 1
filled%
= page.h:
GOSUB displaydoc
clipboardconvert:
myCLIPBOARD$
= MID$(myCLIPBOARD$
, 1, j%
- 1) + CHR$(255) + MID$(myCLIPBOARD$
, j%
+ 2) j% = j% + 2
debugger:
PRINT "mark rw col"; mark%; markrow%; markcol%;
" " PRINT "orig o1 o2"; o%;
"o1% ="; o1%;
"o2% ="; o2%;
" " PRINT "dest d1 d2"; d%;
"d1% ="; d1%;
"d2% ="; d2%;
" " PRINT "moving "; mov$;
" " PRINT "o2 - d2 = ";
ABS(o1%
- d1%
);
ABS(o2%
- d2%
);
" " PRINT "yy% xx% "; yy%; xx%;
" " PRINT "yy% multi ";
(yy%
- 1) * dwidth
+ col;
" " PRINT "cutmrow% "; cutmrow%; cutmcol%;
" " PRINT "cutdrow% "; cutdrow%; cutdcol%;
" " PRINT "row col scr"; row; col; scr;
" " PRINT "mhl1% "; mhl1%;
" " PRINT "mhl1row% "; mhl1row%;
" " PRINT "mhl1col% "; mhl1col%;
" " PRINT "locked% "; locked%;
" " PRINT "scrb.x i s"; scrb.x; scrb.i; scrb.s;
" " PRINT "b$ "; b$; kloop%;
" " PRINT "cur$ cur% "; cur$; cur%;
"" PRINT "cursor.t / b"; cursor.top; cursor.bot;
" ";
PRINT "scrbardrag% "; scrbardrag%; draglock%;
" ";