User Tools

Site Tools


cdc:nos2.source:opl871:fsescrn

FSESCRN

Table Of Contents

  • [00004] SCREEN EDITING MODULE.
  • [00063] DOSCREEN - MIMIC ON-SCREEN MANIPULATIONS IN INPUT.
  • [00199] SETCURSOR - SET CURSOR CONTROLS.
  • [00220] ALIGN - ASSURE FILE ALIGNED WITH CURSOR.
  • [00278] EXTEND - LENGTHEN FILE TO MATCH CURSOR ALIGNMENT.
  • [00328] CLEANLINE - CLEAN UP LINE BUFFER AND FILE BEFORE MOVING.
  • [00416] REJECT - REJECT CHANGE.
  • [00444] MOVETEXT - UPDATE LINE BUFFER WITH OVERSTRIKE.
  • [00505] INSTEXT - OPEN UP SPACE FOR CHARACTER INSERTION.
  • [00562] DELTEXT - DELETE ONE CHARACTER.
  • [00596] DSERRJMP - ERROR JUMP FROM DOSCREEN.
  • [00630] SETCMD - ADD CHARACTER STRING TO COMMAND BUFFER.
  • [00683] INCRCURSOR - INCREMENT CURSOR.
  • [01322] PAINTMARKS - SET SCREEN PAINT BITS FOR MARKS.
  • [01341] DOMARK - WORKING PORTION OF PAINTMARKS.
  • [01377] PAINTSCREEN - OUTPUT NORMAL AND SECONDARY DISPLAYS.
  • [01457] GENDECIMAL - GENERATE A DECIMAL NUMBER.
  • [01504] GENLITERAL - GENERATE A LITERAL STRING.
  • [01550] GENNAME - GENERATE A NAME.
  • [01588] GENTITLE - GENERATE TITLE LINE TEXT.
  • [02255] GLOBALPROMPT - ASK QUESTION FOR GLOBAL OPERATIONS.
  • [02387] GLOBALLOCATE - GLOBAL LOCATE PROMPTING INTERFACE.
  • [02447] GLOBALCHANGE - GLOBAL CHANGE PROMPTING INTERFACE.
  • [02521] BGNDSPLAY - INITIALIZE DEDICATED DISPLAY FORMAT.
  • [02565] ENDDSPLAY - TERMINATE SPECIAL DISPLAY SEQUENCE.
  • [02582] EOLDSPLAY - LINE BY LINE CONTROL FOR SPECIAL DISPLAYS.
  • [02617] PAINTALL - SET PAINT BITS ON ALL LINES.
  • [02630] PAINTNONE - CLEAR PAINT BITS FOR ONE SPLIT.
  • [02653] PAINTREST - SET PAINT BITS FOR REST OF SCREEN.
  • [02685] PAINTSPLIT - SET PAINT BITS ALL LINES ONE SPLIT.
  • [02708] PAINTONESPLT - SET PAINT BITS ALL LINES ONE SPLIT.
  • [02730] SETUPSCREEN - INITIALIZE ALL SCREEN FORMAT CONTROLS.
  • [02757] SETROWSPLIT - INITIALIZE ROWSPLIT VECTOR.
  • [02796] SETROWTYPE - CLASSIFY LINES BY TYPE OF DISPLAY.
  • [02923] CLEARSCREEN - GET BACK TO LINE MODE.
  • [02953] SETTOPBOTS - FORCE TOPS AND BOTS TO BRACKET CURRENT.
  • [02995] SETTOPS - ASSURE TOPS() IS IN FILE BOUNDS.
  • [03012] SETBOTS - SET BOTS() BY TOPS() AND FILE BOUNDS.
  • [03028] REPX - INTERFACE FOR LINE REPLACEMENT.
  • [03061] REPS - INTERNAL LOGIC FOR REPX.
  • [03084] INSX - INTERFACE FOR LINE INSERTION.
  • [03119] INSS - INTERNAL LOGIC FOR INSX.
  • [03167] DELX - INTERFACE FOR LINE DELETION.
  • [03205] DELS - INTERNAL LOGIC FOR DELX.

Source Code

FSESCRN.txt
  1. PROC FSESCRN;
  2. BEGIN
  3. #
  4. *** FSESCRN - SCREEN EDITING MODULE.
  5. *
  6. * COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  7. #
  8.  
  9. DEF LISTCON #0#;
  10.  
  11. *IFCALL SINGLE,COMFSGL
  12. *IFCALL ONLY,COMFONL
  13. *IFCALL MULTI,COMFMLT
  14. *CALL COMFFSE
  15. *CALL COMFDS1
  16. *CALL COMFVD2
  17. *CALL COMFDS2
  18. *CALL COMFTAB
  19.  
  20. *CALL COMFVDT
  21.  
  22. CONTROL IFEQ MULTI,1;
  23. XREF ARRAY RENTSTK [1:MAXREENT]; # SUBROUTINE STACK #
  24. BEGIN
  25. ITEM RSTK;
  26. END
  27. XREF ITEM RSTKPTR;
  28. CONTROL FI;
  29.  
  30.  
  31. XDEF
  32. BEGIN
  33. *CALL COMFXSC
  34. END
  35.  
  36. XREF
  37. BEGIN
  38. *CALL COMFXVT
  39. *CALL COMFXTI
  40. *CALL COMFXFO
  41. *CALL COMFXSB
  42. *CALL COMFXED
  43. END
  44.  
  45. XREF FUNC LENGTH; # COMPASS ROUTINES #
  46. XREF PROC MOVEWD; XREF PROC EXCHWD;
  47. #
  48. MASKS FOR SETTING THE VARIOUS ATTRIBUTES IN ATTRIBMASK (COMFVD2)
  49. #
  50. DEF MSKLOGICAL #O"4000"#; # LOGICAL ATTRIBUTE #
  51. DEF MSKPROTECT #O"2000"#; # PROTECT #
  52. DEF MSKGUARDMD #O"1000"#; # GUARD MODE #
  53. DEF MSKUNDERLN #O"0010"#; # UNDERLINE #
  54. DEF MSKALTERIN #O"0004"#; # ALTERNATE INTENSITY #
  55. DEF MSKINVERSE #O"0002"#; # INVERSE #
  56. DEF MSKBLINKMD #O"0001"#; # BLINK MODE #
  57. PAGE # DOSCREEN - SCREEN MANIPULATIONS #
  58.  
  59.  
  60. PROC DOSCREEN;
  61. IOBEGIN(DOSCREEN)
  62. #
  63. ** DOSCREEN - MIMIC ON-SCREEN MANIPULATIONS IN INPUT.
  64. *
  65. * DOSCREEN PROCESSES ALL SCREEN MODE INPUT. IT PERFORMS
  66. * FILE MANIPULATIONS TO MIMIC SCREEN MANIPULATIONS. IT
  67. * KEEPS FILE POSITIONING UP TO DATE WITH THE USERS CURSOR
  68. * POSITIONING. IT COMPUTES NEW DEFAULT CURSOR POSITIONING
  69. * BETWEEN TRANSACTIONS. IT PROCESS SOME FUNCTION KEYS
  70. * INTERNALLY AND CONVERTS OTHER FUNCTION KEYS INTO COMMAND
  71. * STRINGS. DOSCREEN SHOULD BE CALLED ALTERNATING WITH THE
  72. * COMMAND SCANNER AND THE SCREEN PAINTER.
  73. *
  74. * ENTRY CMDLIN - REPAIRABLE COMMANDS IF ANY OR NULL.
  75. * OUTPUT CYCLE (PAINTSCREEN) EXECUTED.
  76. * VTXCUR, VTYCUR - CURSOR AS SET BY OUTPUT.
  77. * CURFILE, CURSPLIT, CURRENT - AS SET BY
  78. * COMMAND PROCESSING.
  79. * FILENAM[1-2], FILEATTR[1-2] - SET UP.
  80. * XSHIFT[1-2], YSHIFT[1-2] - SHIFT FACTORS.
  81. * TOPS(1-2), BOTS(1-2), BOTF(1-2) - SCREEN BOUNDARIES.
  82. * SETUPSCREEN ALREADY CALLED. (TITLEROW[1-2],
  83. * NUMROWS[1-2], ROWTYPE[1-2], ETC, SETUP)
  84. * ROWPAINT[ALL] - FALSE SINCE PAINTSCREEN CALLED.
  85. * FKEYNAME[ALL,ALL] - SETUP.
  86. * CHARRANGE - INDICATES LINE OR CHARACTER MARKING.
  87. * TABVTPROTM[0] - SETUP.
  88. * COMMANDROW - SETUP.
  89. * PROMPTING - INDICATES NORMAL OR SPECIAL PROMPT.
  90. * EDITFIELD - LOGICAL RIGHT LIMIT ON CHANGES.
  91. *
  92. * EXIT CMDLIN - REPAIRED OR NEWLY ENTERED COMMANDS.
  93. * ROWPAINT[ANY] - POSSIBLY TRUE.
  94. * VTXCUR, VTYCUR - CURSOR AS MOVED BY USER.
  95. * XCURSOR, YCURSOR - SET BY USER THEN POSSIBLY
  96. * UPDATED TO ADVANCE THRU FILE OR TO STAY
  97. * WITH DATA UPON AUTO HALF-PAGE ADVANCE.
  98. * XSHIFT[1-2], YSHIFT[1-2] - POSSIBLY UPDATED.
  99. * TOPS(1-2), BOTS(1-2), BOTF(1-2) - UPDATED.
  100. * CURFILE, CURSPLIT, CURRENT - AS SELECTED BY USER.
  101. * CURCURSOR - USERS LAST VTXCUR, SHIFTED.
  102. * HARDFN - FALSE TO ALLOW PROPER COMMAND OPERATION.
  103. * LIN - TEXT CORRESPONDING TO CURRENT, CURFILE.
  104. *
  105. * MACROS GETCHAR, SETCHAR, YTOL, LTOY.
  106. *
  107. * CALLS (INTERNAL) - ALIGN, CLEANLINE, DELTEXT, DSERRJMP,
  108. * EXTEND, INCRCURSOR, INSTEXT, MOVETEXT, REJECT,
  109. * SETCMD, SETCURSOR.
  110. * (EXTERNAL) - BAKZ, DELX, INSX, LENGTH, PAINTALL,
  111. * PAINTREST, PAINTSPLIT, SETBOTS, SETMARK, SETTOPS,
  112. * TRIMPAD, VDTBOO, VDTEOO, VDTINP, VDTPPI, VFYLOCK.
  113. *
  114. * USES ALIGNGOOD, COMPUTEDPOS, FKEYNDX, HARDFN, LINECHANGED,
  115. * OLDVTXCUR, OLDVTYCUR, READNAM, SCREENLIMIT, SCRNPT1,
  116. * SCRNPT2, SCRNPT3, SCRNPT4, SCRNPT5, SOFTTAB.
  117. *
  118. * NOTE -
  119. *
  120. * DOSCREEN MUST PROCESS ALL INPUT CHARACTERS. THE ONLY UN-
  121. * FINISHED BUSINESS IT MAY LEAVE WOULD BE THE CONTENTS OF THE
  122. * COMMAND BUFFER LINE. DOSCREEN CAN EXIT ONLY THROUGH THE
  123. * "DSEOI" SECTION OR THRU THE DSERRJMP ROUTINE. DOSCREEN MUST
  124. * THEREFORE BE FUNCTIONALLY EQUIVALENT IN BOTH SINGLE AND MULTI
  125. * USER VERSIONS. THE ONLY SINGLE/MULTI COMPILE-TIME DIFFERENCE
  126. * ALLOWABLE WOULD BE MODULE-DEPENDENT OPTIMIZATIONS WHICH CAUSE
  127. * NO TRANSITIONS TO OCCUR.
  128. #
  129.  
  130. # NOTE -- SCREENSW AND VIRTERMATR MUST MATCH SCREENST #
  131.  
  132. SWITCH SCREENSW DSCLRALL, DSCHAR, DSINSC, DSDELC, DSINSL,
  133. DSDELL, DSCLRPAG, DSCLREOP, DSCLRUNP, DSCLREOL, DSPOS,
  134. DSHOME, DSUP, DSDOWN, DSLEFT, DSRIGHT, DSFTAB, DSBTAB,
  135. DSRET, DSERAC, DSERAL, DSEOI, DSRESET, DSFKEY, DSGENERIC,
  136. DSBAD, DSNOOP, DSCOORD, DSPROTECT, DSFIELD, DSCLRTAB, DSSETTAB;
  137.  
  138. ARRAY VIRTERMATR [0:31]; # VIRTUAL TERMINAL ATTRIBUTES #
  139. BEGIN # INDEXED BY VDT ORDINAL #
  140. ITEM NEEDALIGN B(0,0,1)=[
  141. FALSE, TRUE, TRUE, TRUE, # CLRALL, CHAR, IC, DC #
  142. TRUE, TRUE, TRUE, TRUE, # IL, DL, CLRPAG, CLREOP #
  143. TRUE, TRUE, FALSE, FALSE, # CLRUNP, CLREOL, POS, HOME #
  144. FALSE, FALSE, FALSE, FALSE, # UP, DOWN, LEFT, RIGHT #
  145. FALSE, FALSE, FALSE, TRUE, # FTAB, BTAB, RET, ERAC #
  146. TRUE, FALSE, FALSE, TRUE, # ERAL, EOI, RESET, FUNCTION #
  147. TRUE, FALSE, FALSE, FALSE, # GENERIC, BAD, NOOP, COORD #
  148. FALSE, TRUE, FALSE, FALSE # PROTECT, FIELD, CLRTAB, SETTAB#
  149. ];
  150. ITEM NEEDCLEAN B(0,1,1)=[
  151. FALSE, FALSE, FALSE, FALSE, # CLRALL, CHAR, IC, DC #
  152. TRUE, TRUE, FALSE, FALSE, # IL, DL, CLRPAG, CLREOP #
  153. FALSE, FALSE, FALSE, FALSE, # CLRUNP, CLREOL, POS, HOME #
  154. FALSE, FALSE, FALSE, FALSE, # UP, DOWN, LEFT, RIGHT #
  155. FALSE, FALSE, FALSE, FALSE, # FTAB, BTAB, RET, ERAC #
  156. FALSE, TRUE, FALSE, TRUE, # ERAL, EOI, RESET, FUNCTION #
  157. TRUE, FALSE, FALSE, FALSE, # GENERIC, BAD, NOOP, COORD #
  158. FALSE, TRUE, FALSE, FALSE # PROTECT, FIELD, CLRTAB, SETTAB#
  159. ];
  160. ITEM NEEDUNLOCK B(0,2,1)=[
  161. FALSE, TRUE, TRUE, TRUE, # CLRALL, CHAR, IC, DC #
  162. TRUE, TRUE, FALSE, FALSE, # IL, DL, CLRPAG, CLREOP #
  163. FALSE, TRUE, FALSE, FALSE, # CLRUNP, CLREOL, POS, HOME #
  164. FALSE, FALSE, FALSE, FALSE, # UP, DOWN, LEFT, RIGHT #
  165. FALSE, FALSE, FALSE, TRUE, # FTAB, BTAB, RET, ERAC #
  166. TRUE, FALSE, FALSE, FALSE, # ERAL, EOI, RESET, FUNCTION #
  167. FALSE, FALSE, FALSE, FALSE, # GENERIC, BAD, NOOP, COORD #
  168. FALSE, TRUE, FALSE, FALSE # PROTECT, FIELD, CLRTAB, SETTAB#
  169. ];
  170. ITEM NEEDCURSOR B(0,3,1)=[
  171. FALSE, TRUE, TRUE, TRUE, # CLRALL, CHAR, IC, DC #
  172. TRUE, TRUE, TRUE, TRUE, # IL, DL, CLRPAG, CLREOP #
  173. TRUE, TRUE, FALSE, FALSE, # CLRUNP, CLREOL, POS, HOME #
  174. FALSE, FALSE, FALSE, FALSE, # UP, DOWN, LEFT, RIGHT #
  175. FALSE, FALSE, FALSE, TRUE, # FTAB, BTAB, RET, ERAC #
  176. TRUE, FALSE, FALSE, TRUE, # ERAL, EOI, RESET, FUNCTION #
  177. TRUE, FALSE, FALSE, FALSE, # GENERIC, BAD, NOOP, COORD #
  178. FALSE, TRUE, FALSE, FALSE # PROTECT, FIELD, CLRTAB, SETTAB#
  179. ];
  180. ITEM NEEDLIMIT U(0,6,6)=[
  181. 0, 1, 1, 1, # CLRALL, CHAR, IC, DC #
  182. 1, 1, 1, 1, # IL, DL, CLRPAG, CLREOP #
  183. 2, 1, 1, 1, # CLRUNP, CLREOL, POS, HOME #
  184. 1, 1, 1, 1, # UP, DOWN, LEFT, RIGHT #
  185. 1, 1, 0, 1, # FTAB, BTAB, RET, ERAC #
  186. 1, 0, 0, 2, # ERAL, EOI, RESET, FUNCTION #
  187. 2, 0, 0, 0, # GENERIC, BAD, NOOP, COORD #
  188. 0, 1, 0, 0 # PROTECT, FIELD, CLRTAB, SETTAB#
  189. ];
  190. END
  191.  
  192. BASED ARRAY KEYLIN[0:99]; ITEM KEYLINE;
  193. PAGE # SUBROUTINES INTERNAL TO DOSCREEN #
  194.  
  195.  
  196. PROC SETCURSOR;
  197. BEGIN
  198. #
  199. ** SETCURSOR - SET CURSOR CONTROLS.
  200. *
  201. * ENTRY ROWTYPE[ALL], ROWSPLIT[ALL] - SETUP.
  202. *
  203. * EXIT XCURSOR, YCURSOR, COMPUTEDPOS - SETUP.
  204. * CURCURSOR - SET IF YCURSOR ON TEXT ROW.
  205. #
  206. XCURSOR=VTXCUR;
  207. YCURSOR=VTYCUR;
  208. COMPUTEDPOS=TRUE;
  209. IF ROWTYPE[YCURSOR] EQ ROWST"TEXT"
  210. OR ROWTYPE[YCURSOR] EQ ROWST"TITLE" THEN
  211. BEGIN
  212. CURCURSOR=XCURSOR+XSHIFT[ROWSPLIT[YCURSOR]];
  213. CURSPLIT=ROWSPLIT[YCURSOR];
  214. END
  215. END # OF SETCURSOR #
  216.  
  217. PROC ALIGN;
  218. IOBEGIN(ALIGN)
  219. #
  220. ** ALIGN - ASSURE FILE ALIGNED WITH CURSOR.
  221. *
  222. * ENTRY YCURSOR - WHERE THE CURSOR IS.
  223. * CURRENT - MOST RECENT FILE POSITION.
  224. * ROWTYPE[ALL], ROWSPLIT[ALL] - SETUP.
  225. * TOPS(1-2), BOTF(1-2) - SETUP.
  226. * NUMROWS[1-2], SPLITFILE[1-2] - SETUP.
  227. * PROMPTING - WHETHER NORMAL OR SPECIAL DISPLAY.
  228. *
  229. * EXIT ALIGNGOOD - TRUE IF PROMPTING AND SUCCEEDED
  230. * IN GETTING TO RIGHT LINE. FALSE IF CURSOR NOT
  231. * ON TEXT OR IN AREA BEYOND LAST EXTANT LINE.
  232. * CURRENT, CURFILE, CURSPLIT - WHERE WE ARE.
  233. * CURF(CURFILE) - WHERE WE ARE.
  234. *
  235. * MACROS YTOL.
  236. *
  237. * CALLS CLEANLINE, POSZ.
  238. *
  239. * USES SCRNPT1.
  240. #
  241. ALIGNGOOD=FALSE;
  242. IF ROWTYPE[YCURSOR] EQ ROWST"TEXT" OR
  243. (ROWTYPE[YCURSOR] EQ ROWST"TITLE" AND
  244. ROWSPLIT[YCURSOR] EQ CURSPLIT) THEN
  245. BEGIN
  246. EXTENDSIZE=0;
  247. CURSPLIT=ROWSPLIT[YCURSOR];
  248. CURSPLIT=MIN(MAX(CURSPLIT,1),2);
  249. SCRNPT1=YTOL(YCURSOR,CURSPLIT);
  250. IF SCRNPT1 LQ MIN(TOPS(CURSPLIT)+NUMROWS[CURSPLIT],
  251. BOTF(SPLITFILE[CURSPLIT])-1) THEN
  252. BEGIN
  253. IF NOT PROMPTING AND ROWTYPE[YCURSOR] EQ
  254. ROWST"TEXT" THEN ALIGNGOOD=TRUE;
  255. IF CURRENT NQ SCRNPT1
  256. OR CURFILE NQ SPLITFILE[CURSPLIT] THEN
  257. BEGIN
  258. CLEANLINE;
  259. CURF(CURFILE)=CURRENT;
  260. POSZ(SCRNPT1);
  261. CURFILE=SPLITFILE[CURSPLIT];
  262. END
  263. END
  264. ELSE
  265. BEGIN
  266. CLEANLINE;
  267. CURFILE=SPLITFILE[CURSPLIT];
  268. POSZ(BOTF(CURFILE)-1);
  269. CURF(CURFILE)=CURRENT;
  270. EXTENDSIZE=SCRNPT1-BOTF(CURFILE)+1;
  271. END
  272. END
  273. IOEND # OF ALIGN #
  274.  
  275. PROC EXTEND;
  276. IOBEGIN(EXTEND)
  277. #
  278. ** EXTEND - LENGTHEN FILE TO MATCH CURSOR ALIGNMENT.
  279. *
  280. * ENTRY ALIGN ROUTINE RECENTLY CALLED.
  281. * ALIGNGOOD - RESULT OF ALIGN ROUTINE.
  282. * ROWTYPE[ALL], ROWSPLIT[ALL] - SETUP.
  283. * BOTF(1-2), SPLITFILE[1-2] - SETUP.
  284. * CURRENT - MOST RECENT FILE POSITION.
  285. * PROMPTING - NORMAL OR SPECIAL DISPLAY.
  286. *
  287. * EXIT ALIGNGOOD - ASSURED TRUE UNLESS PROMPTING.
  288. * CURSPLIT, CURRENT, CURFILE - WHERE WE ARE.
  289. * CURF(CURFILE) - WHERE WE WERE BEFORE CHANGING CURFILE.
  290. * HARDFN - FALSE IF WE EXTENDED THE FILE.
  291. * FILE IS POSSIBLY LONGER.
  292. *
  293. * MACROS YTOL.
  294. *
  295. * CALLS CLEANLINE, POSZ, INSZ.
  296. *
  297. * USES LIN.
  298. *
  299. * NOTE ALGORITHM ASSUMES CURSOR INDICATES FILE EXTENSION
  300. * ANYTIME IT IS ON A TEXT ROW BUT ALIGNGOOD IS OFF AND
  301. * THE FILE POSITION EXCEEDS BOTF(SPLITFILE[CURSPLIT]).
  302. #
  303. IF NOT ALIGNGOOD THEN
  304. BEGIN
  305. IF ROWTYPE[YCURSOR] EQ ROWST"TEXT" THEN
  306. BEGIN
  307. CURSPLIT=ROWSPLIT[YCURSOR];
  308. CURSPLIT=MIN(MAX(CURSPLIT,1),2);
  309. IF YTOL(YCURSOR,CURSPLIT) GQ BOTF(SPLITFILE[CURSPLIT]) THEN
  310. BEGIN
  311. CLEANLINE;
  312. CURF(CURFILE)=CURRENT;
  313. POSZ(BOTF(SPLITFILE[CURSPLIT])-1);
  314. LINE[0]=NULLIN;
  315. HARDFN=FALSE;
  316. FOR SCRNPT4=LTOY(CURRENT,CURSPLIT)+1 STEP 1
  317. UNTIL YCURSOR DO INSZ;
  318. IF NOT PROMPTING THEN ALIGNGOOD=TRUE;
  319. CURFILE=SPLITFILE[CURSPLIT];
  320. END
  321. END
  322. END
  323. IOEND # OF EXTEND #
  324.  
  325. PROC CLEANLINE;
  326. IOBEGIN(CLEANLINE)
  327. #
  328. ** CLEANLINE - CLEAN UP LINE BUFFER AND FILE BEFORE MOVING.
  329. *
  330. * ENTRY LINECHANGED - LINE BUFFER RECENTLY ALTERED.
  331. * LIN - THE LINE BUFFER.
  332. * CURRENT - WHERE WE ARE IN THE FILE.
  333. * SOFTTAB - TRUE IF ANY CHANGE WAS SOFT-TAB OVERSTRIKE.
  334. * CURFILE - WHICH FILE BRACKET WE ARE IN.
  335. * CURSPLIT - WHICH SCREEN BRACKET WE ARE IN.
  336. * NUMBERED[CURFILE] - SEQUENCING MODE FOR THIS FILE.
  337. * WIDTH - USERS LINE WIDTH THRESHHOLD.
  338. *
  339. * EXIT ANY CHANGES TO LINE BUFFER ARE IN WORKFILE.
  340. * SEQUENCE NUMBERS ADJUSTED TO NUMWIDTH.
  341. * OUT-OF-SEQUENCE NUMBERS BLANKED OUT.
  342. * LINECHANGED, SOFTTAB - CLEARED.
  343. * ERRSTRING - POSSIBLE WIDE LINE WARNING.
  344. * ROWPAINT[THIS LINE] - POSSIBLY TRUE.
  345. *
  346. * MACROS SETCHAR, LTOY.
  347. *
  348. * CALLS COPYLIN, DOTAB, TRIMPAD, REPX, GETLNUM, SETLNUM,
  349. * PUSH, BAKNUM, POP, FWDNUM, LENGTH.
  350. *
  351. * USES WIDTHFOUND, LINENO, SCRNPT2, SCRNPT3.
  352. #
  353. IF LINECHANGED THEN
  354. BEGIN
  355. LINECHANGED=FALSE;
  356. IF SOFTTAB THEN
  357. BEGIN
  358. SOFTTAB=FALSE;
  359. COPYLIN(LIN,TTYLIN);
  360. DOTAB(NUMWIDBLK,NUMWIDBLK,NUMWIDBLK);
  361. COPYLIN(TTYLIN,LIN);
  362. END
  363. TRIMPAD;
  364. REPX;
  365. IF NUMBERED[CURFILE] NQ 0 THEN
  366. BEGIN # ASSURE ASCENDING NUMBERS #
  367. GETLNUM; # SEE IF ANY NUMBER TO FIX #
  368. IF WIDTHFOUND NQ 0 THEN
  369. BEGIN
  370. IF WIDTHFOUND NQ NUMWIDTH THEN # NOT STANDARD #
  371. BEGIN
  372. SETLNUM;
  373. HARDFN=FALSE;
  374. REPX;
  375. END
  376. ELSE # DIGITS OK BUT CHECK BLANK #
  377. BEGIN
  378. GETCHAR(LINE,NUMWIDTH,SCRNPT2);
  379. IF BLANKS NQ 0 AND SCRNPT2 NQ CBLANK THEN
  380. BEGIN
  381. RSHIFT(LIN,NUMWIDTH,1);
  382. SETCHAR(LINE,NUMWIDTH,CBLANK);
  383. END
  384. END
  385. SCRNPT2=LINENO; # VERIFY BOUNDARIES #
  386. PUSH;
  387. BAKNUM;
  388. POP;
  389. SCRNPT3=LINENO;
  390. PUSH;
  391. FWDNUM;
  392. POP;
  393. IF SCRNPT2 LQ SCRNPT3 OR SCRNPT2 GQ LINENO THEN
  394. BEGIN # NOT ASCEND SO BLANKOUT #
  395. FOR SCRNPT2=1 STEP 1 UNTIL NUMWIDTH
  396. DO SETCHAR(LINE,SCRNPT2-1,CBLANK);
  397. END
  398. HARDFN=FALSE;
  399. REPX;
  400. END
  401. END
  402. IF LENGTH(LIN) GR WIDTH+NUMWIDBLK AND ERRSTRING EQ " $" THEN
  403. BEGIN
  404. ERRSTRING="WIDE LINE$";
  405. END
  406. END
  407. IOEND # OF CLEANLINE #
  408.  
  409.  
  410. PROC REJECT;
  411. # TITLE REJECT - REJECT CHANGE. #
  412.  
  413. BEGIN # REJECT #
  414.  
  415. #
  416. ** REJECT - REJECT CHANGE.
  417. *
  418. * A KEYBOARD CHANGE WAS MADE ON A ROW THAT IN NOT ALLOWED.
  419. * FLAG THE ROW FOR REPAINT AND IF ITS A TITLE ROW, INDICATE
  420. * A TOTAL REPAINT.
  421. *
  422. * PROC REJECT
  423. #
  424.  
  425. ROWPAINT[YCURSOR]=TRUE;
  426. IF ROWTYPE[YCURSOR] EQ ROWST"TITLE" THEN
  427. BEGIN
  428. IF ROWSPLIT[YCURSOR] EQ 1 THEN TITLE1LINE[0]=NULLIN;
  429. ELSE TITLE2LINE[0]=NULLIN;
  430. END
  431. IF ROWTYPE[YCURSOR] EQ ROWST"TITLE"
  432. OR ROWTYPE[YCURSOR] EQ ROWST"LABEL"
  433. OR ROWTYPE[YCURSOR] EQ ROWST"RESPONSE" THEN
  434. BEGIN
  435. ERRSTRING = "CHANGES OUTSIDE OF TEXT AREA DISCARDED$";
  436. END
  437.  
  438. END # REJECT #
  439.  
  440.  
  441. PROC MOVETEXT(TEXTLIN,OFFSET,FENCE);
  442. BEGIN
  443. #
  444. ** MOVETEXT - UPDATE LINE BUFFER WITH OVERSTRIKE.
  445. *
  446. * ENTRY TEXTLIN - WHICH LINE BUFFER TO UPDATE.
  447. * XCURSOR, OFFSET - WHERE TO UPDATE.
  448. * CURSPLIT, YCURSOR - WHERE WE ARE.
  449. * FENCE - RIGHT HAND BOUNDARY FOR CHANGES.
  450. * ASCII[CURFILE] - INDICATES CASE SUPPRESSION.
  451. * TABCHAR - SOFT TAB CHARACTER.
  452. * VTCHAR - THE CHARACTER TO OVERSTRIKE.
  453. *
  454. * EXIT THE CHARACTER IS IN PLACE IF POSSIBLE.
  455. * SOFTTAB - POSSIBLY TRUE.
  456. * ROWPAINT[YCURSOR] - POSSIBLY TRUE.
  457. *
  458. * MACROS SETCHAR.
  459. *
  460. * CALLS EXTENDC, DSPLCOD.
  461. #
  462.  
  463. ARRAY TEXTLIN[0:99];
  464. BEGIN # ARRAY TEXTLIN #
  465. ITEM TEXTLINE I; # LINE BUFFER TO UPDATE #
  466. END # ARRAY TEXTLIN #
  467.  
  468. ITEM OFFSET I; # COLUMN OFFSET #
  469. ITEM FENCE I; # RIGHT SIDE BOUNDARY #
  470. ITEM TMP1 I; # TEMPORARY STORAGE #
  471. ITEM TMP2 I; # TEMPORARY STORAGE #
  472.  
  473. TMP2=XCURSOR+OFFSET;
  474. IF TMP2 GQ FENCE THEN RETURN;
  475. EXTENDC(TEXTLIN,TMP2);
  476. TMP1=XLTXPINT[VTCHAR];
  477. IF ASCII[CURFILE] LQ 1 THEN # SUPPRESS LOWER CASE #
  478. BEGIN
  479. # NEXT CODE IS DEPENDENT ON PRECISE VALUES OF INTERNAL CHARSET #
  480. CONTROL IFNQ CLEFTCURL,O"133"; DEFERROR; CONTROL FI;
  481. CONTROL IFNQ CVERTICAL,O"134"; DEFERROR; CONTROL FI;
  482. CONTROL IFNQ CRITECURL,O"135"; DEFERROR; CONTROL FI;
  483. CONTROL IFNQ CTILDE,O"136"; DEFERROR; CONTROL FI;
  484. CONTROL IFNQ CGRAVE,O"100"; DEFERROR; CONTROL FI;
  485. CONTROL IFNQ CCOLON,O"000"; DEFERROR; CONTROL FI;
  486. # ISSUE WARNING FOR NON-EXISTENT DISPLAY CODE CHARACTERS #
  487. IF (TMP1 GQ O"133" AND TMP1 LQ O"136")
  488. OR (TMP1 EQ O"100") THEN ROWPAINT[YCURSOR]=TRUE;
  489. IF (B<00,01>MEM[CSMR] EQ 0)
  490. AND (TMP1 EQ O"000") THEN ROWPAINT[YCURSOR]=TRUE;
  491. DSPLCOD(TMP1); # SUPPRESS LOWER CASE #
  492. END
  493. SETCHAR(TEXTLINE,TMP2,TMP1);
  494. IF TMP1 EQ TABCHAR THEN
  495. BEGIN
  496. SOFTTAB=TRUE;
  497. ROWPAINT[YCURSOR]=TRUE;
  498. END
  499. END # MOVETEXT #
  500.  
  501.  
  502. PROC INSTEXT(TEXTLIN,OFFSET,FENCE);
  503. BEGIN
  504. #
  505. ** INSTEXT - OPEN UP SPACE FOR CHARACTER INSERTION.
  506. *
  507. * ENTRY SAME AS MOVETEXT ROUTINE.
  508. *
  509. * EXIT THE CHARACTER SPACE IS OPENED UP.
  510. *
  511. * MACROS SETCHAR.
  512. *
  513. * CALLS RSHIFT, LSHIFT.
  514. #
  515.  
  516. ARRAY TEXTLIN[0:99];
  517. BEGIN # ARRAY TEXTLIN #
  518. ITEM TEXTLINE I; # LINE BUFFER TO UPDATE #
  519. END # ARRAY TEXTLIN #
  520.  
  521. ITEM OFFSET I; # COLUMN OFFSET #
  522. ITEM FENCE I; # RIGHT SIDE BOUNDARY #
  523. ITEM TMP1 I; # TEMPORARY STORAGE #
  524. ITEM TMP2 I; # TEMPORARY STORAGE #
  525.  
  526. TMP1=XCURSOR+OFFSET;
  527. IF TMP1 GQ FENCE THEN RETURN;
  528. RSHIFT(TEXTLIN,TMP1,1);
  529. TMP2=XLTXPINT[VTCHAR];
  530. IF ASCII[CURFILE] LQ 1 THEN # SUPPRESS LOWER CASE #
  531. BEGIN
  532. # NEXT CODE IS DEPENDENT ON PRECISE VALUES OF INTERNAL CHARSET #
  533. CONTROL IFNQ CLEFTCURL,O"133"; DEFERROR; CONTROL FI;
  534. CONTROL IFNQ CVERTICAL,O"134"; DEFERROR; CONTROL FI;
  535. CONTROL IFNQ CRITECURL,O"135"; DEFERROR; CONTROL FI;
  536. CONTROL IFNQ CTILDE,O"136"; DEFERROR; CONTROL FI;
  537. CONTROL IFNQ CGRAVE,O"100"; DEFERROR; CONTROL FI;
  538. CONTROL IFNQ CCOLON,O"000"; DEFERROR; CONTROL FI;
  539. # ISSUE WARNING FOR NON-EXISTENT DISPLAY CODE CHARACTERS #
  540. IF (TMP2 GQ O"133" AND TMP2 LQ O"136")
  541. OR (TMP2 EQ O"100") THEN ROWPAINT[YCURSOR]=TRUE;
  542. IF (B<00,01>MEM[CSMR] EQ 0)
  543. AND (TMP2 EQ O"000") THEN ROWPAINT[YCURSOR]=TRUE;
  544. DSPLCOD(TMP2); # SUPPRESS LOWER CASE #
  545. END
  546. SETCHAR(TEXTLINE,TMP1,TMP2);
  547. IF TMP2 EQ TABCHAR THEN
  548. BEGIN
  549. SOFTTAB=TRUE;
  550. ROWPAINT[YCURSOR]=TRUE;
  551. END
  552. IF FENCE LS BUFCM1 THEN
  553. BEGIN
  554. LSHIFT(TEXTLIN,EDITFIELD+1,1);
  555. END
  556. END # INSTEXT #
  557.  
  558.  
  559. PROC DELTEXT(TEXTLIN,OFFSET,FENCE);
  560. BEGIN
  561. #
  562. ** DELTEXT - DELETE ONE CHARACTER.
  563. *
  564. * ENTRY SAME AS MOVETEXT.
  565. *
  566. * EXIT TEXT SHIFTED TO CLOSEUP ONE PLACE.
  567. *
  568. * MACROS SETCHAR.
  569. *
  570. * CALLS LSHIFT, RSHIFT.
  571. #
  572.  
  573. ARRAY TEXTLIN[0:99];
  574. BEGIN # ARRAY TEXTLIN #
  575. ITEM TEXTLINE I; # LINE BUFFER TO UPDATE #
  576. END # ARRAY TEXTLIN #
  577.  
  578. ITEM OFFSET I; # COLUMN OFFSET #
  579. ITEM FENCE I; # RIGHT SIDE BOUNDARY #
  580. ITEM TMP1 I; # TEMPORARY STORAGE #
  581.  
  582. TMP1=XCURSOR+OFFSET;
  583. IF TMP1 GQ FENCE THEN RETURN;
  584. LSHIFT(TEXTLIN,TMP1+1,1);
  585. IF FENCE LS BUFCM1 THEN
  586. BEGIN
  587. RSHIFT(TEXTLIN,EDITFIELD-1,1);
  588. SETCHAR(TEXTLINE,EDITFIELD-1,CBLANK);
  589. END
  590. END # DELTEXT #
  591.  
  592.  
  593. PROC DSERRJMP(STR); # DOSCREEN ERROR JUMP #
  594. IOBEGIN(DSERRJMP)
  595. #
  596. ** DSERRJMP - ERROR JUMP FROM DOSCREEN.
  597. *
  598. * ENTRY STR - ERROR MESSAGE.
  599. * PROMPTING - NORMAL OR SPECIAL DISPLAY.
  600. * COMMANDROW - SETUP.
  601. *
  602. * EXIT VIA ERRJUMP.
  603. * CMDLIN - NULLED OUT.
  604. * ERRSTRING - CONTAINS MESSAGE.
  605. * TOKENPOS - MINUS ONE FOR ERRJUMP.
  606. * ROWPAINT[COMMANDROW] - TRUE.
  607. * ROWPAINT[ALL] - POSSIBLY TRUE.
  608. *
  609. * CALLS PAINTALL, VDTBEL, VDTDRN, ERRJUMP.
  610. *
  611. * NOTE THIS ROUTINE UNCONDITIONALLY USES ERRJUMP, THUS
  612. * CONTROL WILL NEVER RETURN TO THE CALLER. DSERRJMP
  613. * IS THE ONLY WAY TO CALL ERRJUMP FROM DOSCREEN OR
  614. * ANY OF ITS INTERNAL ROUTINES.
  615. #
  616. ITEM STR C(40);
  617. ERRSTRING=STR;
  618. ROWPAINT[COMMANDROW]=TRUE;
  619. IF PROMPTING THEN PAINTALL;
  620. VDTBEL;
  621. VDTDRN; # ASSURE INPUT BUFFER CLEAN #
  622. TOKENPOS=-1; # ASSURE OLD CURSOR POSITION #
  623. CMDLINE[0]=NULLIN;
  624. ERRJUMP(ERRSTRING); # CONTROL DOES NOT RETURN #
  625. IOEND # OF DSERRJMP #
  626.  
  627. PROC SETCMD(CMD);
  628. BEGIN
  629. #
  630. ** SETCMD - ADD CHARACTER STRING TO COMMAND BUFFER.
  631. *
  632. * ENTRY CMD - STRING TO BE ADDED, 10 CHARS IN DISPLAY CODE.
  633. * CMDLIN - ANY EXISTING COMMAND CONTENT. (INTERNAL CODE)
  634. *
  635. * EXIT CMDLIN - UPDATED.
  636. *
  637. * MACROS SETCHAR.
  638. *
  639. * CALLS LENGTH.
  640. *
  641. * USES SCRNPT3, SCRNPT4, SCRNPT5.
  642. #
  643. ITEM CMD C(10);
  644. SCRNPT4=LENGTH(CMDLIN);
  645. IF SCRNPT4+10 LS BUFCM1 THEN
  646. BEGIN
  647. SETCHAR(CMDLINE,SCRNPT4,CSEMCOLON);
  648. FOR SCRNPT5=0 STEP 1 UNTIL 9 DO
  649. BEGIN
  650. SCRNPT3=XLTDSPINT[C<SCRNPT5,1>CMD];
  651. SETCHAR(CMDLINE,SCRNPT4+1+SCRNPT5,SCRNPT3);
  652. END
  653. SETCHAR(CMDLINE,SCRNPT4+11,CENDLINE);
  654. END
  655. END # OF SETCMD #
  656.  
  657.  
  658. PROC ADDTOCMD;
  659. BEGIN
  660. # ADD TEXT FROM KEYLINE TO CMDLINE #
  661. SCRNPT3=LENGTH(CMDLIN);
  662. SCRNPT2=LENGTH(KEYLIN);
  663. IF SCRNPT3+SCRNPT2 LS BUFCM1 THEN
  664. BEGIN
  665. SETCHAR(CMDLINE,SCRNPT3,CSEMCOLON);
  666. FOR SCRNPT4=0 STEP 1 UNTIL SCRNPT2 DO
  667. BEGIN
  668. GETCHAR(KEYLINE,SCRNPT4,SCRNPT5);
  669. SETCHAR(CMDLINE,SCRNPT3+SCRNPT4+1,SCRNPT5);
  670. IF (SCRNPT5 EQ CAMPER) AND (NOT PROMPTING)
  671. AND (EXPANDAT LS 0) THEN EXPANDAT=SCRNPT3+SCRNPT4+1;
  672. END
  673. END
  674. END # ADDTOCMD #
  675.  
  676.  
  677. PROC INCRCURSOR;
  678. # TITLE INCRCURSOR - INCREMENT CURSOR. #
  679.  
  680. BEGIN # INCRCURSOR #
  681.  
  682. #
  683. ** INCRCURSOR - INCREMENT CURSOR.
  684. *
  685. * EXIT XCURSOR - ZERO.
  686. * YCURSOR - USERS CURSOR OR ONE PLACE BEYOND.
  687. *
  688. * CALLS SETCURSOR.
  689. #
  690.  
  691. SETCURSOR;
  692. XCURSOR=0;
  693. IF ROWTYPE[YCURSOR] EQ ROWST"TEXT" THEN YCURSOR=YCURSOR+1;
  694.  
  695. END # INCRCURSOR #
  696. PAGE # START OF DOSCREEN MAIN CODE #
  697.  
  698.  
  699. SCREENLIMIT=0;
  700. COMPUTEDPOS=FALSE;
  701. VDTEOO; # ISSUE INPUT CONTROL PROMPT #
  702. VDTPPI; # GET INPUT, VERIFY XPARENT #
  703. VDTBOO; # START NEW OUTPUT CYCLE #
  704. IF VTORDN NQ 0 THEN
  705. BEGIN # IF SOME INPUT WAS LOST #
  706. VDTBEL;
  707. TOKENPOS=0;
  708. SETCMD("SS");
  709. ERRSTRING="PLEASE RE-ENTER INPUT$";
  710. GOTO DSEOI; # SIMULATE *ENTER* #
  711. END
  712. XCURSOR=0;
  713.  
  714. FIRSTEVENT=TRUE;
  715. GOTO DSLOOP2;
  716.  
  717. #
  718. SCREEN ROUTINES RETURN BASED UPON WHERE THEY WOULD LIKE
  719. THE CURSOR IF <EOL> WERE ENTERED IMMEDIATELY AFTER THE
  720. ROUTINE. THE CHOICES ARE
  721.  
  722. DSLOOP: LEAVE THE CURSOR WHERE IT IS.
  723. DSX0Y1: SET X TO ZERO, INCREMENT Y IF IN VALID TEXT.
  724. LEAVE Y WHERE IT IS IF CANNOT INCREMENT.
  725. #
  726.  
  727. DSX0Y1:
  728. INCRCURSOR;
  729. DSLOOP:
  730. FIRSTEVENT=FALSE;
  731. DSLOOP2:
  732. OLDVTXCURS=VTXCUR;
  733. OLDVTYCURS=VTYCUR;
  734. VDTIINP;
  735. DSLOOP3:
  736. IF SCREENLIMIT LS 2 THEN
  737. BEGIN
  738. IF NEEDCURSOR[VTORDN] THEN SETCURSOR;
  739. IF NEEDALIGN[VTORDN] THEN ALIGN;
  740. IF NEEDCLEAN[VTORDN] THEN CLEANLINE;
  741. END
  742. IF NEEDLIMIT[VTORDN] NQ 0 THEN
  743. BEGIN
  744. IF NEEDLIMIT[VTORDN] LS SCREENLIMIT AND SCREENLIMIT NQ 0 THEN
  745. BEGIN
  746. PAINTALL;
  747. VTINCR = 0; # DISABLE CURSOR ADVANCE #
  748. DSERRJMP("RETURN MUST FOLLOW FUNCTION KEY$");
  749. END
  750. SCREENLIMIT=NEEDLIMIT[VTORDN];
  751. END
  752. IF NEEDUNLOCK[VTORDN] AND ROWTYPE[YCURSOR] EQ ROWST"TEXT" THEN
  753. BEGIN
  754. IF LOCKED[CURFILE] NQ 0 THEN
  755. BEGIN
  756. ROWPAINT[YCURSOR]=TRUE; # CURRENT LINE IS SPOILED #
  757. IF VTORDN EQ SCREENST"INSL" OR VTORDN EQ SCREENST"DELL" THEN
  758. BEGIN # LOWER LINES ARE SPOILED #
  759. PAINTSPLIT; # AT LEAST TILL FIELD PROTECT #
  760. IF NOT TABVTPROTM[0] THEN PAINTREST(YCURSOR);
  761. END
  762. DSERRJMP("CANNOT CHANGE READ-ONLY FILE$");
  763. END
  764. END
  765. HARDFN=TRUE;
  766. GOTO SCREENSW[VTORDN];
  767.  
  768. DSUP:
  769. DSDOWN:
  770. DSRET:
  771. DSNOOP:
  772. DSCOORD:
  773. DSPROTECT:
  774. GOTO DSLOOP;
  775.  
  776.  
  777. DSPOS:
  778. DSRESET:
  779. GOTO DSBAD;
  780.  
  781. DSEOI:
  782. # NOTE THAT AN EOI VDT EVENT IS NOT TAGGED FOR EITHER CURSOR #
  783. # SETTING OR FILE POSITION ALIGNMENT. THE DSEOI SECTION DOES #
  784. # THIS MANUALLY TO ALLOW FOR REACTION TO VARYING CONDITIONS. #
  785. CLEANLINE;
  786. IF SCREENLIMIT LS 2 THEN
  787. BEGIN
  788. IF COMPUTEDPOS THEN SETCURSOR;
  789. ALIGN;
  790. INCRCURSOR;
  791. IF LENGTH(CMDLIN) EQ 0 AND YCURSOR EQ VTYCUR+1 AND
  792. VTYCUR EQ TITLEROW[CURSPLIT]+NUMROWS[CURSPLIT] AND
  793. NOT PROMPTING THEN
  794. BEGIN # IF AUTO HALF PAGE FORWARD #
  795. TOPS(CURSPLIT)=BOTS(CURSPLIT)-NUMROWS[CURSPLIT]/2;
  796. SETTOPS(CURSPLIT);
  797. XCURSOR=0;
  798. YCURSOR=BOTS(CURSPLIT);
  799. YCURSOR=LTOY(YCURSOR,CURSPLIT);
  800. SETBOTS(CURSPLIT);
  801. PAINTSPLIT;
  802. END
  803. ALIGN;
  804. END
  805. HARDFN = FALSE; # CLEAR HARD FUNCTION PRESSED #
  806. VDTDRN; # ASSURE CLEAN INPUT BUFFER #
  807. IF FIRSTEVENT THEN CMDLINE[0]=NULLIN;
  808. IF AUTOINDENT THEN
  809. BEGIN # IF SET JUMP ENABLED #
  810. IF XCURSOR EQ 0 AND YCURSOR NQ COMMANDROW
  811. AND LENGTH(CMDLIN) EQ 0 THEN
  812. BEGIN # IF REASONABLE TO DO #
  813. SCRNPT3 = 0;
  814. SCRNPT4 = 0;
  815. IF NOTEXT THEN
  816. BEGIN # IF CURRENT LINE IS EMPTY #
  817. SCRNPT4 = 1; # CHECK PREVIOUS LINE #
  818. BAKZ;
  819. END
  820. IF NOT NOTEXT THEN
  821. BEGIN # IF LINE IS NOT EMPTY #
  822. GETCHAR(LINE,XSHIFT[CURSPLIT],SCRNPT2);
  823. WHYLE SCRNPT2 EQ CBLANK DO
  824. BEGIN # IF LEADING BLANK(S) #
  825. SCRNPT3 = SCRNPT3 + 1;
  826. GETCHAR(LINE,XSHIFT[CURSPLIT]+SCRNPT3,SCRNPT2);
  827. END
  828. END
  829. IF SCRNPT4 EQ 1 THEN FWDZ; # RESET IF NECESSARY #
  830. XCURSOR = SCRNPT3;
  831. END
  832. END
  833. IORET
  834.  
  835. DSHOME:
  836. XCURSOR=VTOXPOS;
  837. YCURSOR=VTOYPOS;
  838. IF ROWTYPE[YCURSOR] EQ ROWST"TEXT" OR ROWTYPE[YCURSOR]
  839. EQ ROWST"TITLE" THEN CURSPLIT=ROWSPLIT[YCURSOR];
  840. CURCURSOR=XCURSOR+XSHIFT[CURSPLIT];
  841. ALIGN;
  842. GOTO DSLOOP;
  843.  
  844. DSCLREOL:
  845. IF ROWTYPE[YCURSOR] EQ ROWST"COMMAND" THEN
  846. BEGIN
  847. SETCHAR(CMDLINE,XCURSOR,CENDLINE);
  848. IF XCURSOR EQ 0 THEN ROWPAINT[COMMANDROW] = FALSE;
  849. END
  850. ELSE IF ALIGNGOOD THEN
  851. BEGIN
  852. FOR SCRNPT1=XCURSOR+XSHIFT[CURSPLIT] STEP 1
  853. UNTIL EDITFIELD-1 DO SETCHAR(LINE,SCRNPT1,CBLANK);
  854. SETCHAR(LINE,BUFCHAR,CENDLINE);
  855. TRIMPAD;
  856. LINECHANGED=TRUE;
  857. END
  858. ELSE REJECT;
  859. GOTO DSX0Y1;
  860.  
  861. DSCLRPAG: DSCLRUNP: DSCLREOP:
  862. PAINTALL;
  863. SETCMD("SETSCR");
  864. GOTO DSLOOP;
  865.  
  866. DSCHAR:
  867. IF YCURSOR EQ COMMANDROW THEN
  868. BEGIN
  869. MOVETEXT(CMDLIN,0,BUFCM1);
  870. ROWPAINT[COMMANDROW] = TRUE;
  871. END
  872. ELSE
  873. BEGIN
  874. EXTEND;
  875. IF ALIGNGOOD THEN
  876. BEGIN
  877. SCRNPT1=LENGTH(LIN);
  878. MOVETEXT(LIN,XSHIFT[CURSPLIT],EDITFIELD);
  879. LINECHANGED=TRUE;
  880. END
  881. ELSE REJECT;
  882. END
  883. GOTO DSX0Y1;
  884.  
  885. DSINSC:
  886. IF YCURSOR EQ COMMANDROW THEN
  887. BEGIN # IF COMMANDROW #
  888. ROWPAINT[COMMANDROW] = TRUE;
  889. INSTEXT(CMDLIN,0,BUFCM1);
  890. END
  891. ELSE
  892. BEGIN
  893. EXTEND;
  894. IF ALIGNGOOD THEN
  895. BEGIN
  896. INSTEXT(LIN,XSHIFT[CURSPLIT],EDITFIELD);
  897. IF CURRENT EQ REGLINE[MARKREG] AND VTXCUR LS MRKCHAR[0] THEN
  898. MRKCHAR[0] = MRKCHAR[0] + 1; # IF INSERT BEFORE FIRST MARK #
  899. IF CURRENT EQ REGLINE[MARKREG+1] AND VTXCUR LQ MRKCHAR[1] THEN
  900. MRKCHAR[1] = MRKCHAR[1] + 1; # IF INSERT BEFORE LAST MARK #
  901. LINECHANGED=TRUE;
  902. END
  903. ELSE REJECT;
  904. END
  905. GOTO DSX0Y1;
  906.  
  907. DSDELC:
  908. IF YCURSOR EQ COMMANDROW THEN
  909. BEGIN
  910. DELTEXT(CMDLIN,0,BUFCM1);
  911. IF LENGTH(CMDLIN) EQ 0 THEN ROWPAINT[COMMANDROW] = FALSE;
  912. END
  913. ELSE IF ALIGNGOOD THEN
  914. BEGIN
  915. IF HARDFN AND LENGTH(LIN) GR XSHIFT[CURSPLIT]+USRNUMCOL
  916. THEN ROWPAINT[YCURSOR]=TRUE;
  917. DELTEXT(LIN,XSHIFT[CURSPLIT],EDITFIELD);
  918. IF CURRENT EQ REGLINE[MARKREG] AND VTXCUR LS MRKCHAR[0] THEN
  919. MRKCHAR[0] = MRKCHAR[0] - 1; # IF DELETE BEFORE FIRST MARK #
  920. IF CURRENT EQ REGLINE[MARKREG+1] AND VTXCUR LQ MRKCHAR[1] THEN
  921. BEGIN # IF DELETE BEFORE LAST MARK #
  922. MRKCHAR[1] = MRKCHAR[1] - 1;
  923. IF REGLINE[MARKREG] LS CURRENT THEN
  924. BEGIN # IF MORE THAN ONE MARKED LINE #
  925. IF MRKCHAR[1] LS 0 THEN
  926. BEGIN # IF NO MARKS LEFT ON LAST LINE #
  927. REGLINE[MARKREG+1] = CURRENT - 1;
  928. END
  929. END
  930. ELSE
  931. BEGIN # IF ONLY ONE MARKED LINE #
  932. IF MRKCHAR[1] LS MRKCHAR[0] OR MRKCHAR[1] LS 0 THEN
  933. KILLMARKS = TRUE; # IF NO MARKS LEFT #
  934. END
  935. END
  936. LINECHANGED=TRUE;
  937. END
  938. ELSE REJECT;
  939. GOTO DSX0Y1;
  940.  
  941. DSINSL:
  942. EXTEND;
  943. IF ALIGNGOOD THEN
  944. BEGIN
  945. IF CURRENT NQ TOPS(CURSPLIT) THEN BAKZ;
  946. LINE[0]=NULLIN;
  947. HARDFN = TRUE;
  948. INSX;
  949. END
  950. ELSE
  951. BEGIN
  952. REJECT;
  953. IF HARDFN AND NOT TABVTPROTM[0] THEN PAINTREST(YCURSOR);
  954. END
  955. GOTO DSX0Y1;
  956.  
  957. DSLEFT:
  958. IF TABVTPROTM[0] THEN
  959. BEGIN
  960. IF ROWTYPE[VTYCUR] EQ ROWST"TITLE"
  961. OR (ROWTYPE[VTYCUR] EQ ROWST"LABEL" AND VTXCUR LS FKEYLEN) THEN
  962. BEGIN # IF CURSOR IN PROTECTED AREA #
  963. VDTCOR(VTYCUR-1,VTXMAX); # CURSOR IS UP ONE LINE #
  964. END
  965. END
  966. GOTO DSLOOP;
  967.  
  968. DSRIGHT:
  969. IF TABVTPROTM[0] THEN
  970. BEGIN
  971. IF ROWTYPE[VTYCUR] EQ ROWST"TITLE" THEN
  972. BEGIN # IF ON TITLE LINE #
  973. VDTCOR(VTYCUR+1,0); # CURSOR ONE LINE DOWN #
  974. END
  975. ELSE IF ROWTYPE[VTYCUR] EQ ROWST"LABEL" AND VTXCUR LS FKEYLEN THEN
  976. BEGIN # IF ON FUNCTION KEY LABEL LINE #
  977. VDTCOR(VTYCUR,FKEYLEN); # CURSOR IS PAST LABELS #
  978. END
  979. END
  980. GOTO DSLOOP;
  981.  
  982. DSCLRALL:
  983. VDTSTS(0); # RESTORE COLUMN 1 TAB STOP #
  984. FOR SCRNPT2=1 STEP 1 UNTIL TABWORDS DO
  985. BEGIN # MARK ALL OTHER TABS CLEAR #
  986. TABVCTWRD[SCRNPT2] = 0;
  987. END
  988. GOTO DSLOOP;
  989.  
  990. DSCLRTAB:
  991. DSSETTAB:
  992. FOR SCRNPT3=1 STEP 1 UNTIL USERTABS DO
  993. BEGIN
  994. SCRNPT2 = TABFN(SCRNPT3);
  995. IF SCRNPT2 GQ VTXCUR OR SCRNPT2 EQ 0 THEN
  996. BEGIN # IF FOUND THE SPOT #
  997. IF VTORDN EQ SCREENST"SETTAB" THEN
  998. BEGIN # IF SETTING TAB STOP #
  999. IF SCRNPT2 NQ VTXCUR AND VTXCUR GR 0 THEN
  1000. BEGIN # IF TAB STOP NOT ALREADY SET #
  1001. SCRNPT4 = VTXCUR;
  1002. FOR SCRNPT3 = SCRNPT3-1 STEP 1
  1003. WHILE SCRNPT3 LS USERTABS AND SCRNPT4 GR 0 DO
  1004. BEGIN
  1005. SCRNPT2 = SCRNPT4;
  1006. SCRNPT4 = TABFN(SCRNPT3+1);
  1007. SCRNPT5 = SCRNPT3/7;
  1008. SCRNPT6 = MOD(SCRNPT3,7);
  1009. B<SCRNPT6*8,8>TABVCTWRD[SCRNPT5+1] = SCRNPT2;
  1010. END
  1011. END
  1012. END
  1013. ELSE
  1014. BEGIN # IF CLEARING TAB STOP #
  1015. IF VTXCUR GR 0 THEN
  1016. BEGIN # IF NOT IN COLUMN 1 #
  1017. IF SCRNPT2 EQ VTXCUR THEN
  1018. BEGIN # IF TAB STOP ACTUALLY SET #
  1019. FOR SCRNPT3 = SCRNPT3 STEP 1
  1020. WHILE SCRNPT3 LS USERTABS AND SCRNPT2 GR 0 DO
  1021. BEGIN # REMOVE THE TAB STOP #
  1022. SCRNPT2 = TABFN(SCRNPT3+1);
  1023. SCRNPT5 = (SCRNPT3-1)/7;
  1024. SCRNPT6 = MOD(SCRNPT3-1,7);
  1025. B<SCRNPT6*8,8>TABVCTWRD[SCRNPT5+1] = SCRNPT2;
  1026. END
  1027. END
  1028. END
  1029. ELSE
  1030. BEGIN # IF COLUMN 1 TAB STOP CLEARED #
  1031. VDTSTS(0); # RESTORE COLUMN 1 TAB STOP #
  1032. END
  1033. END
  1034. GOTO DSLOOP;
  1035. END
  1036. END
  1037. GOTO DSLOOP;
  1038.  
  1039. DSFTAB:
  1040. SCRNPT4 = TABFN(1);
  1041. FOR SCRNPT3=1 STEP 1 UNTIL USERTABS DO
  1042. BEGIN
  1043. SCRNPT2 = TABFN(SCRNPT3);
  1044. IF SCRNPT2 LS SCRNPT4 OR SCRNPT2 GR VTXMAX THEN
  1045. BEGIN # WRAPAROUND #
  1046. GOTO DSFTAB2;
  1047. END
  1048. IF SCRNPT2 GR VTXCUR THEN
  1049. BEGIN # THIS IS IT #
  1050. SCRNPT4 = VTYCUR;
  1051. GOTO DSFTAB3;
  1052. END
  1053. END
  1054. DSFTAB2:
  1055. IF TABUNDWFLN[0] THEN GOTO DSLOOP; # IF FORWARD TABS DO NOT WRAP #
  1056. IF ROWTYPE[VTYCUR] EQ ROWST"LABEL"
  1057. AND TABVTPROTM[0]
  1058. AND VTXCUR LS FKEYLEN THEN
  1059. BEGIN # IF WITHIN PROTECTED LABEL LINE #
  1060. VDTCOR(VTYCUR,FKEYLEN);
  1061. GOTO DSLOOP;
  1062. END
  1063. SCRNPT2 = 0;
  1064. SCRNPT4 = VTYCUR + 1;
  1065. IF SCRNPT4 GR VTYMAX THEN SCRNPT4 = 0;
  1066. DSFTAB3:
  1067. IF TABVTPROTM[0] THEN
  1068. BEGIN # IF EDITOR USES PROTECT #
  1069. IF ROWTYPE[SCRNPT4] EQ ROWST"TITLE" THEN
  1070. BEGIN # IF PROTECTED TITLE LINE #
  1071. SCRNPT4 = SCRNPT4 + 1; # ADVANCE PAST TITLE LINE #
  1072. SCRNPT2 = 0;
  1073. END
  1074. ELSE IF ROWTYPE[SCRNPT4] EQ ROWST"LABEL"
  1075. AND SCRNPT2 LS FKEYLEN THEN
  1076. BEGIN # IF IN PROTECTED LABEL AREA #
  1077. SCRNPT2 = FKEYLEN;
  1078. END
  1079. END
  1080. VDTCOR(SCRNPT4,SCRNPT2);
  1081. GOTO DSLOOP;
  1082.  
  1083. DSBTAB:
  1084. IF TABUNDWBLN[0] AND VTXCUR EQ 0 THEN GOTO DSLOOP; # IF NO WRAP #
  1085. SCRNPT1=-1;
  1086. SCRNPT2=TABFN(TABSTOPS);
  1087. FOR SCRNPT3=USERTABS STEP -1 UNTIL 1 DO
  1088. BEGIN
  1089. SCRNPT4 = TABFN(SCRNPT3);
  1090. IF SCRNPT1 LS 0 THEN
  1091. BEGIN # IF LAST VALID TAB NOT FOUND #
  1092. IF SCRNPT4 LQ SCRNPT2 OR SCRNPT4 GR VTXMAX THEN TEST SCRNPT3;
  1093. SCRNPT1 = SCRNPT4;
  1094. END
  1095. IF SCRNPT4 LS VTXCUR THEN
  1096. BEGIN # IF LEFT OF CURRENT POSITION #
  1097. IF TABVTPROTM[0] THEN
  1098. BEGIN # IF EDITOR USES PROTECT #
  1099. IF ROWTYPE[VTYCUR] EQ ROWST"TITLE" THEN GOTO DSBTAB2;
  1100. IF ROWTYPE[VTYCUR] EQ ROWST"LABEL" THEN
  1101. BEGIN # IF PROTECTED LABEL LINE #
  1102. IF VTXCUR LQ FKEYLEN THEN GOTO DSBTAB2;
  1103. SCRNPT4 = MAX(SCRNPT4,FKEYLEN);
  1104. END
  1105. END
  1106. VDTCOR(VTYCUR,SCRNPT4);
  1107. GOTO DSLOOP;
  1108. END
  1109. END
  1110. IF VTXCUR GR 0
  1111. AND NOT (TABVTPROTM[0] AND ROWTYPE[VTYCUR] EQ ROWST"LABEL") THEN
  1112. BEGIN
  1113. VDTCOR(VTYCUR,0);
  1114. GOTO DSLOOP;
  1115. END
  1116. DSBTAB2:
  1117. SCRNPT1=MAX(SCRNPT1,0);
  1118. SCRNPT4=VTYCUR-1;
  1119. IF SCRNPT4 LS 0 THEN SCRNPT4=VTYMAX;
  1120. IF TABVTPROTM[0] THEN
  1121. BEGIN # IF EDITOR USES PROTECT #
  1122. IF ROWTYPE[SCRNPT4] EQ ROWST"TITLE" THEN
  1123. BEGIN # IF PROTECTED TITLE LINE #
  1124. SCRNPT4 = SCRNPT4 - 1; # BACK UP PAST TITLE LINE #
  1125. END
  1126. ELSE IF ROWTYPE[SCRNPT4] EQ ROWST"LABEL" THEN
  1127. BEGIN # IF PROTECTED LABEL LINE #
  1128. SCRNPT1 = MAX(SCRNPT1,FKEYLEN);
  1129. END
  1130. END
  1131. VDTCOR(SCRNPT4,SCRNPT1);
  1132. GOTO DSLOOP;
  1133.  
  1134. DSDELL:
  1135. IF ALIGNGOOD THEN
  1136. BEGIN
  1137. IF CURRENT LS BOTS(CURSPLIT) THEN DELX;
  1138. END
  1139. ELSE
  1140. BEGIN
  1141. REJECT;
  1142. IF HARDFN AND NOT TABVTPROTM[0] THEN PAINTREST(YCURSOR);
  1143. IF ROWTYPE[YCURSOR] EQ ROWST"COMMAND" THEN
  1144. BEGIN # IF DELETE ON COMMAND LINE #
  1145. SETCHAR(CMDLINE,0,CENDLINE);
  1146. END
  1147. END
  1148. LINECHANGED=FALSE;
  1149. GOTO DSX0Y1;
  1150.  
  1151. DSGENERIC:
  1152. IF FIRSTEVENT THEN CMDLINE[0]=NULLIN;
  1153. IF ABS(VTCHAR) EQ GENERICST"GHELP" THEN SETCMD("HELP");
  1154. ELSE IF ABS(VTCHAR) EQ GENERICST"GBACK" THEN SETCMD("BACK");
  1155. ELSE IF ABS(VTCHAR) EQ GENERICST"GDATA" THEN SETCMD("DATA");
  1156. ELSE IF ABS(VTCHAR) EQ GENERICST"GEDIT" THEN SETCMD("EDIT");
  1157. ELSE IF ABS(VTCHAR) EQ GENERICST"GSTOP" THEN
  1158. BEGIN
  1159. SETCMD("SETSCR");
  1160. IF NOT PROMPTING THEN SETCMD("SETLIN");
  1161. END
  1162. ELSE IF VTCHAR EQ GENERICST"GFWD" THEN SETCMD("VNS");
  1163. ELSE IF VTCHAR EQ GENERICST"GBKW" THEN SETCMD("VPS");
  1164. ELSE IF -VTCHAR EQ GENERICST"GFWD" THEN SETCMD("VL");
  1165. ELSE IF -VTCHAR EQ GENERICST"GBKW" THEN SETCMD("PF");
  1166. ELSE IF VTCHAR EQ GENERICST"GUP" THEN SETCMD("VN");
  1167. ELSE IF VTCHAR EQ GENERICST"GDOWN" THEN SETCMD("VP");
  1168. ELSE IF TABCURADDT[0] EQ 2 AND
  1169. TABVTFKLSM[0] NQ 0 AND
  1170. VTCHAR EQ GENERICST"GPOS" THEN
  1171. ROWPAINT[YCURSOR] = TRUE; # 721 FULL DUPLEX TOUCH PANEL #
  1172. ELSE GOTO DSLOOP;
  1173. GOTO DSFKEY2;
  1174.  
  1175. DSFKEY:
  1176. IF FIRSTEVENT THEN CMDLINE[0]=NULLIN;
  1177. IF ABS(VTCHAR) GR POSFKEYS OR VTCHAR EQ 0
  1178. THEN DSERRJMP("UNSUPPORTED FUNCTION KEY$");
  1179. P<KEYLIN>=LOC(FKEYSTRING[VTCHAR]);
  1180. SCRNPT2=LENGTH(KEYLIN);
  1181. IF SCRNPT2 GQ 15 THEN
  1182. BEGIN
  1183. PUSH;
  1184. POSZ(TOPK(FKEYS)+VTCHAR+POSFKEYS);
  1185. P<KEYLIN>=LOC(LIN);
  1186. ADDTOCMD;
  1187. POP;
  1188. END
  1189. ELSE ADDTOCMD;
  1190. DSFKEY2:
  1191. HARDFN=FALSE;
  1192. IF TABVTFKLSM[0] NQ 0 THEN ROWPAINT[YCURSOR] = TRUE;
  1193. IF PROMPTING THEN # SIGNAL OVERRIDE OF SECONDARY #
  1194. BEGIN
  1195. HALT("DIRECTIVE CANCELLED BY FUNCTION KEY$");
  1196. ESCAPE=TRUE;
  1197. END
  1198. GOTO DSLOOP;
  1199.  
  1200. DSERAC:
  1201. VTCHAR=X"20"; # BLANK #
  1202. VTORDN=SCREENST"CHAR";
  1203. GOTO DSCHAR;
  1204.  
  1205. DSERAL:
  1206. IF ROWTYPE[YCURSOR] EQ ROWST"COMMAND" THEN
  1207. BEGIN
  1208. SETCHAR(CMDLINE,0,CENDLINE);
  1209. ROWPAINT[COMMANDROW] = FALSE;
  1210. END
  1211. ELSE IF ALIGNGOOD THEN
  1212. BEGIN
  1213. FOR SCRNPT1=XSHIFT[CURSPLIT] STEP 1
  1214. UNTIL EDITFIELD-1 DO SETCHAR(LINE,SCRNPT1,CBLANK);
  1215. SETCHAR(LINE,BUFCHAR,CENDLINE);
  1216. TRIMPAD;
  1217. LINECHANGED=TRUE;
  1218. END
  1219. ELSE REJECT;
  1220. GOTO DSX0Y1;
  1221.  
  1222. DSFIELD:
  1223. IF YCURSOR EQ COMMANDROW THEN
  1224. BEGIN
  1225. VDTIINP; # GET FIRST CHARACTER OF FIELD #
  1226. FOR SCRNPT1 = 0 STEP 1 WHILE VTORDN EQ SCREENST"CHAR" DO
  1227. BEGIN
  1228. MOVETEXT(CMDLIN,SCRNPT1,BUFCM1);
  1229. VDTIINP; # GET NEXT CHARACTER OF FIELD #
  1230. END
  1231. SETCHAR(CMDLINE,SCRNPT1,CENDLINE);
  1232. ROWPAINT[COMMANDROW] = TRUE;
  1233. END
  1234. ELSE
  1235. BEGIN
  1236. EXTEND;
  1237. IF ALIGNGOOD THEN
  1238. BEGIN # IF ALIGN IS O.K. #
  1239. SCRNPT2 = LENGTH(LIN); # SAVE CURRENT LINE LENGTH #
  1240. VDTIINP; # GET FIRST CHARACTER OF FIELD #
  1241. FOR XCURSOR = 0 STEP 1 WHILE VTORDN EQ SCREENST"CHAR" DO
  1242. BEGIN
  1243. IF XCURSOR + XSHIFT[CURSPLIT] LS EDITFIELD THEN
  1244. BEGIN # IF WITHIN EDITING WINDOW #
  1245. SCRNPT1 = XLTXPINT[VTCHAR];
  1246. IF ASCII[CURFILE] LQ 1 THEN
  1247. BEGIN # IF SUPPRESSING LOWER CASE #
  1248. # CODE IS DEPENDENT ON PRECISE VALUES OF INTERNAL CHARSET #
  1249. CONTROL IFNQ CLEFTCURL,O"133"; DEFERROR; CONTROL FI;
  1250. CONTROL IFNQ CVERTICAL,O"134"; DEFERROR; CONTROL FI;
  1251. CONTROL IFNQ CRITECURL,O"135"; DEFERROR; CONTROL FI;
  1252. CONTROL IFNQ CTILDE,O"136"; DEFERROR; CONTROL FI;
  1253. CONTROL IFNQ CGRAVE,O"100"; DEFERROR; CONTROL FI;
  1254. CONTROL IFNQ CCOLON,O"000"; DEFERROR; CONTROL FI;
  1255. # REPAINT IF NON-EXISTENT DISPLAY CODE CHARACTER #
  1256. IF (SCRNPT1 GQ O"133" AND SCRNPT1 LQ O"136")
  1257. OR (SCRNPT1 EQ O"100") THEN ROWPAINT[YCURSOR] = TRUE;
  1258. IF (B<00,01>MEM[CSMR] EQ 0)
  1259. AND (SCRNPT1 EQ O"000") THEN ROWPAINT[YCURSOR]=TRUE;
  1260. DSPLCOD(SCRNPT1); # SUPRESS LOWER CASE #
  1261. END
  1262. SETCHAR(LINE,XCURSOR+XSHIFT[CURSPLIT],SCRNPT1);
  1263. IF SCRNPT1 EQ TABCHAR THEN
  1264. BEGIN # IF SOFT TAB #
  1265. SOFTTAB = TRUE;
  1266. ROWPAINT[YCURSOR] = TRUE;
  1267. END
  1268. END
  1269. VDTIINP; # GET NEXT CHARACTER OF FIELD #
  1270. END
  1271. #
  1272. PERFORM NECESSARY PADDING AND SET END OF LINE.
  1273. #
  1274. SCRNPT1 = XSHIFT[CURSPLIT] + XCURSOR;
  1275. IF SCRNPT1 LS SCRNPT2 THEN
  1276. BEGIN # IF LINE WAS SHORTENED #
  1277. FOR SCRNPT3 = SCRNPT1 STEP 1 UNTIL
  1278. MIN(SCRNPT2-1,MIN(EDITFIELD-1,XSHIFT[CURSPLIT]+USRNUMCOL)) DO
  1279. BEGIN
  1280. SETCHAR(LINE,SCRNPT3,CBLANK);
  1281. END
  1282. TRIMPAD;
  1283. END
  1284. ELSE
  1285. BEGIN # LINE NOT SHORTENED #
  1286. IF SCRNPT2 LS XSHIFT[CURSPLIT] THEN
  1287. BEGIN # IF LINE LENGTHENED #
  1288. IF EDITFIELD GQ XSHIFT[CURSPLIT] THEN
  1289. BEGIN # IF WITHIN EDITING WINDOW #
  1290. FOR SCRNPT3 = SCRNPT2 STEP 1 UNTIL XSHIFT[CURSPLIT] - 1 DO
  1291. SETCHAR(LINE,SCRNPT3,CBLANK);
  1292. SETCHAR(LINE,MIN(SCRNPT1,EDITFIELD),CENDLINE);
  1293. END
  1294. END
  1295. ELSE
  1296. BEGIN # NO CHANGE IN LINE LENGTH #
  1297. SETCHAR(LINE,MIN(SCRNPT1,MAX(SCRNPT2,EDITFIELD)),CENDLINE);
  1298. END
  1299. END
  1300. LINECHANGED = TRUE; # TEXT OF LINE ALTERED #
  1301. END
  1302. ELSE
  1303. BEGIN # ALIGN BAD #
  1304. REJECT; # REJECT CHANGE #
  1305. END
  1306. END
  1307. GOTO DSLOOP3; # CONTINUE WITH INPUT #
  1308.  
  1309.  
  1310. DSBAD:
  1311. ERRSTRING = "UNKNOWN CONTROL KEY, CHECK SCREEN$";
  1312. ROWPAINT[VTYCUR] = TRUE; # SIGNAL REPAINT OF LINE #
  1313. GOTO DSLOOP;
  1314.  
  1315. IOEND # DOSCREEN #
  1316. PAGE # SCREEN OUTPUT/CONTROL #
  1317.  
  1318.  
  1319. PROC PAINTMARKS(MARKTYPE);
  1320. BEGIN
  1321. #
  1322. ** PAINTMARKS - SET SCREEN PAINT BITS FOR MARKS.
  1323. *
  1324. * ENTRY MARKTYPE - 1=FORCE HIGHLIGHTING ON.
  1325. * 2=MAINTAIN EXISTING HIGHLIGHTS.
  1326. * 3=FORCE HIGHLIGHTING OFF.
  1327. * TOPS(BOTH), BOTS(BOTH) - SETUP.
  1328. * REGLINE[MARKREG AND MARKREG+1] - ALREADY SET.
  1329. * SPLITFILE[2] - WHETHER TWO SPLITS ARE ON SCREEN.
  1330. *
  1331. * EXIT ROWPMARK[ALL] - FORCED ON OR OFF BY REGIONS.
  1332. * ROWPAINT[ANY] - FORCED TRUE AS NEEDED.
  1333. *
  1334. * CALLS DOMARK (INTERNAL).
  1335. #
  1336. ITEM MARKTYPE;
  1337.  
  1338. PROC DOMARK(SPLT);
  1339. BEGIN
  1340. #
  1341. ** DOMARK - WORKING PORTION OF PAINTMARKS.
  1342. *
  1343. * NOTE REFER TO PAINTMARKS HEADER.
  1344. #
  1345. ITEM L1, L2, SPLT;
  1346. FOR L1=TOPS(SPLT)+1 STEP 1 UNTIL BOTS(SPLT)-1 DO
  1347. BEGIN
  1348. L2=LTOY(L1,SPLT);
  1349. ROWPMARK[L2]=FALSE;
  1350. IF L1 GQ REGLINE[MARKREG] AND L1 LQ REGLINE[MARKREG+1] THEN
  1351. BEGIN
  1352. IF MARKTYPE NQ 2 THEN ROWPAINT[L2]=TRUE;
  1353. IF MARKTYPE NQ 3 THEN ROWPMARK[L2]=TRUE;
  1354. END
  1355. IF TABATTRCHR[0] THEN
  1356. BEGIN # IF ATTRIBUTE TAKES A POS #
  1357. IF L1 EQ REGLINE[MARKREG] AND MARKTYPE EQ 3 THEN
  1358. BEGIN # IF CLEARING MARKS #
  1359. ROWPAINT[L2-1] = TRUE; # FLAG FOR REPAINT #
  1360. END
  1361. END
  1362. END
  1363. END
  1364.  
  1365. IF NUMMARKS GR 0 THEN # SEE IF NEED TO HIGHLIGHT ANY #
  1366. BEGIN
  1367. DOMARK(1);
  1368. IF SPLITFILE[2] NQ 0 THEN DOMARK(2);
  1369. END
  1370.  
  1371. END # OF PAINTMARKS #
  1372.  
  1373.  
  1374. PROC PAINTSCREEN;
  1375. IOBEGIN(PAINTSCREEN)
  1376. #
  1377. ** PAINTSCREEN - OUTPUT NORMAL AND SECONDARY DISPLAYS.
  1378. *
  1379. * PAINTSCREEN IS CALLED TO FILL A DISPLAY PAGE. THE
  1380. * PROMPTING FLAG INDICATES WHETHER THIS IS A NORMAL
  1381. * (PRIMARY) DISPLAY OR A SECONDARY DISPLAY. THE ROWPAINT
  1382. * BITS INDICATE WHICH PORTIONS OF THE SCREEN ARE ALREADY
  1383. * CORRECT AND WHICH REALLY NEED TO BE PAINTED. THE YCURSOR
  1384. * IS FORCED TO POINT TO EITHER TEXT OR THE COMMAND AREA IF
  1385. * IT DOES NOT ALREADY. ANY MESSAGE IN THE ERROR STRING
  1386. * BUFFER IS OUTPUT AND CLEARED. IF AN ERROEOUS COMMAND WAS
  1387. * PREVIOUSLY ATTEMPTED, PAINTSCREEN RECOGNIZES THIS AND
  1388. * RE-PRINTS THE OLD COMMAND BUFFER WITH THE CURSOR FLASHING
  1389. * AT THE ILLEGAL SYNTAX. FILE POSITIONING IS FORCED TO
  1390. * ALIGN WITH THE CURSOR FOR ON-TEXT CURSORS. TITLE LINES
  1391. * ARE VERIFIED FOR CORRECTNESS AND POSSIBLY PAINTED.
  1392. *
  1393. * ENTRY YCURSOR - COMMAND PROCESSOR'S FAVORITE CURSOR.
  1394. * NEGATIVE=SELECT CURSOR FOR CURRENT LINE.
  1395. * ON TEXT OR COMMAND ROW=USE THAT.
  1396. * XCURSOR - ALSO WHERE COMMAND PROCESSOR WANT IT.
  1397. * VTXMAX - MAXIMUM COLUMN POSITION.
  1398. * ROWTYPE[ALL], ROWSPLIT[ALL] - SETUP.
  1399. * SPLITFILE[1-2] - SETUP.
  1400. * CURRENT, CURFILE, CURSPLIT - WHERE WE ARE.
  1401. * PROMPTING - PRIMARY OR SECONDARY DISPLAY.
  1402. * LTPS(1-2), LASTBOTS, LASTSIZE, LASTNAME - MUST
  1403. * BE LEFT OVER FROM PREVIOUS PAINTSCREEN OR -1.
  1404. * COMMANDROW - SETUP.
  1405. * ROWORIG[ALL] - MUST BE AS LEFT BY LAST CALL HERE
  1406. * EXCEPT AS UPDATED BY DELX AND INSX.
  1407. * ROWPAINT[ALL] - WHICH LINES NEED PAINTING.
  1408. * TOPS(1-2), BOTS(1-2) - SETUP.
  1409. * ROWCOLUM[ALL] - WHERE WANT SCALE PATTERN PAINTED.
  1410. * XSHIFT[1-2] - SETUP.
  1411. * MRKCHAR[0-1] - SETUP.
  1412. * USRNUMCOL, USRNUMLIN - LOGICAL DIMENSIONS.
  1413. * ERRSTRING - ERROR MESSAGE BUFFER.
  1414. * CMDLIN - RESIDUAL COMMAND BUFFER.
  1415. * TOPF(1-2), BOTF(1-2) - SETUP.
  1416. * FKEYSHOW - HOW MANY FUNCTION KEYS TO DISPLAY.
  1417. * SHIFTFKEY - FLAG TO DISPLAY SHIFTED FUNCTION KEYS.
  1418. * ERRCURSOR - IF POSITIVE, XCURSOR FOR SYNTAX ERROR.
  1419. *
  1420. * EXIT XCURSOR, YCURSOR - POSSIBLY AT NEW LOCATION.
  1421. * TOPS(1-2), BOTS(1-2) - POSSIBLY UPDATED.
  1422. * CURFILE - UPDATED IF YCURSOR UPDATED.
  1423. * CURSPLIT - UPDATED IF YCURSOR UPDATED.
  1424. * ERRSTRING - POSSIBLY WIDE LINE WARNING.
  1425. * ROWPAINT[ALL] - FALSE EXCEPT POSSIBLY COMMANDROW.
  1426. * ROWORIG[ALL] - REDEFINED.
  1427. * ROWCOLUM[ALL] - FALSE.
  1428. * ROWPMARK[ALL] - FALSE.
  1429. * LTPS(1-2), LASTBOTS, LASTSIZE, LASTNAME - REDEFINED.
  1430. *
  1431. * MACROS GETCHAR, SETCHAR, LTOY.
  1432. *
  1433. * CALLS GENDECIMAL, GENLITERAL, GENNAME, GENTITLE, LENGTH,
  1434. * PAINTMARKS, PAINTSPLIT, POSZ, SETTOPBOTS, TRIMPAD,
  1435. * TTLCSTR, TTDEC, TTLFN, TTSTR, TTST, VDTCHR, VDTCLL
  1436. * VDTPOS, VDTSAM.
  1437. *
  1438. * USES SPLIT, FILNUM, FKEYNDX, SCRNPT1, SCRNPT2,
  1439. * SCRNPT3, SCRNPT4, SCRNPT5, SCRNPT6, LIN.
  1440. #
  1441.  
  1442. SWITCH PAINTSW
  1443. PTEMPTY, # EMPTY LINE #
  1444. PTCMD, # COMMAND LINE #
  1445. PTTITLE, # TITLE LINE #
  1446. PTLABEL, # FUNCTION KEY LABEL LINE #
  1447. PTTEXT, # TEXT LINE #
  1448. PTRESPONSE; # FSE COMMAND RESPONSE LINE #
  1449.  
  1450.  
  1451. PROC GENDECIMAL(POS,VALUE);
  1452. # TITLE GENDECIMAL - GENERATE A DECIMAL NUMBER. #
  1453.  
  1454. BEGIN # GENDECIMAL #
  1455.  
  1456. #
  1457. ** GENDECIMAL - GENERATE A DECIMAL NUMBER.
  1458. *
  1459. * CONVERT A DISPLAY CODE VALUE TO DECIMAL AND POSITION
  1460. * IT IN THE TTYLINE.
  1461. *
  1462. * PROC GENDECIMAL(POS,VALUE)
  1463. *
  1464. * EXIT TTYLINE - SETUP.
  1465. *
  1466. * CALLS SETCHAR.
  1467. *
  1468. * USES TTYLINE.
  1469. #
  1470.  
  1471. ITEM POS I; # POSITION OF NUMBER #
  1472. ITEM QUIT B; # FINISHED FLAG #
  1473. ITEM TMP1 I; # TEMPORARY STORAGE #
  1474. ITEM TMP2 I; # TEMPORARY STORAGE #
  1475. ITEM TMP3 I; # TEMPORARY STORAGE #
  1476. ITEM VALUE I; # VALUE TO CONVERT #
  1477.  
  1478. TMP1=ABS(VALUE);
  1479. TMP2=0; # COUNT DIGITS #
  1480. QUIT=FALSE;
  1481. WHYLE NOT QUIT DO # NOT DONE YET #
  1482. BEGIN
  1483. C<TMP2>TMP3=MOD(TMP1,10)+O"33"; # GET A DIGIT #
  1484. TMP1=TMP1/10; # REDUCE NUMBER #
  1485. TMP2=TMP2+1; # BUMP POINTER #
  1486. IF TMP1 EQ 0 THEN QUIT=TRUE;
  1487. END
  1488.  
  1489. FOR TMP1=1 STEP 1 UNTIL TMP2 DO
  1490. BEGIN
  1491. SETCHAR(TTYLINE,POS,XLTDSPINT[C<TMP2-TMP1>TMP3]);
  1492. POS=POS+1;
  1493. END
  1494.  
  1495. END # GENDECIMAL #
  1496.  
  1497.  
  1498. PROC GENLITERAL(POS,STR);
  1499. # TITLE GENLITERAL - GENERATE A LITERAL STRING. #
  1500.  
  1501. BEGIN # GENLITERAL #
  1502.  
  1503. #
  1504. ** GENLITERAL - GENERATE A LITERAL STRING.
  1505. *
  1506. * GENERATE A LITERAL STRING AND POSITION IT IN THE
  1507. * TTYLINE.
  1508. *
  1509. * PROC GENLITERAL(POS,STR)
  1510. *
  1511. * EXIT TTYLINE - SETUP.
  1512. *
  1513. * CALLS SETCHAR.
  1514. *
  1515. * USES TTYLINE.
  1516. #
  1517.  
  1518. ITEM BEGINWORD B; # BEGINNING WORD #
  1519. ITEM POS I; # POSITION OF STRING #
  1520. ITEM STR C(40); # STRING TO CONVERT #
  1521. ITEM TMP1 I; # TEMPORARY STORAGE #
  1522. ITEM TMP2 I; # TEMPORARY STORAGE #
  1523.  
  1524. BEGINWORD=TRUE;
  1525. TMP1=0;
  1526. WHYLE TMP1 LS 40 AND C<TMP1>STR NQ "$" DO
  1527. BEGIN
  1528. TMP2=C<TMP1>STR;
  1529. TMP2=XLTDSPINT[TMP2];
  1530. IF TMP2 GQ CLETTERA AND TMP2 LQ CLETTERZ THEN
  1531. BEGIN
  1532. IF NOT BEGINWORD THEN TMP2=TMP2+CLOWERA-CLETTERA;
  1533. BEGINWORD=FALSE;
  1534. END
  1535. ELSE BEGINWORD=TRUE;
  1536. SETCHAR(TTYLINE,POS,TMP2);
  1537. POS=POS+1;
  1538. TMP1=TMP1+1;
  1539. END
  1540.  
  1541. END # GENLITERAL #
  1542.  
  1543.  
  1544. PROC GENNAME(POS,NAME);
  1545. # TITLE GENNAME - GENERATE A NAME. #
  1546.  
  1547. BEGIN # GENNAME #
  1548.  
  1549. #
  1550. ** GENNAME - GENERATE A NAME.
  1551. *
  1552. * GENERATE A NAME AND POSITION IT IN THE TTYLINE.
  1553. *
  1554. * PROC GENNAME(POS,NAME)
  1555. *
  1556. * EXIT TTYLINE - SETUP.
  1557. *
  1558. * CALLS SETCHAR.
  1559. *
  1560. * USES TTYLINE.
  1561. #
  1562.  
  1563. ITEM NAME C(07); # NAME TO CONVERT #
  1564. ITEM POS I; # POSITION OF NAME #
  1565. ITEM TMP1 I; # TEMPORARY STORAGE #
  1566. ITEM TMP2 I; # TEMPORARY STORAGE #
  1567.  
  1568. FOR TMP1=0 STEP 1 UNTIL 6 DO
  1569. BEGIN
  1570. TMP2=C<TMP1>NAME;
  1571. IF TMP2 NQ 0 AND TMP2 NQ O"55" THEN
  1572. BEGIN
  1573. TMP2=XLTDSPINT[TMP2];
  1574. SETCHAR(TTYLINE,POS,TMP2);
  1575. POS=POS+1;
  1576. END
  1577. END
  1578.  
  1579. END # GENNAME #
  1580.  
  1581.  
  1582. PROC GENTITLE(SPLIT);
  1583. # TITLE GENTITLE - GENERATE TITLE LINE TEXT. #
  1584.  
  1585. BEGIN # GENTITLE #
  1586.  
  1587. #
  1588. ** GENTITLE - GENERATE TITLE LINE TEXT.
  1589. *
  1590. * GIVEN A SPLIT, GENERATE THE TITLE LINE.
  1591. *
  1592. * PROC GENTITLE(SPLIT)
  1593. *
  1594. * ENTRY SPLIT - WHICH SPLIT TO GENERATE TITLE FOR.
  1595. *
  1596. * EXIT TTYLIN - TEXT FOR TITLE LINE.
  1597. *
  1598. * CALLS GENDECIMAL, GENLITERAL, GENNAME, SETCHAR.
  1599. *
  1600. USES TTYLIN.
  1601. #
  1602.  
  1603. ITEM FILE I; # FILE SPLIT #
  1604. ITEM POS I; # POSITION OF TEXT #
  1605. ITEM SPLIT I; # TITLE SPLIT #
  1606.  
  1607. POS=0;
  1608. IF TABATTRCHR[0] THEN GENLITERAL(POS," $");
  1609. FILE=SPLITFILE[SPLIT];
  1610. IF ASCII[FILE] LQ 1 THEN GENLITERAL(POS,"UPPER CASE $");
  1611. GENLITERAL(POS,"FILE $");
  1612. GENNAME(POS,FILENAM[FILE]);
  1613. GENLITERAL(POS," $");
  1614. IF NOT SHORTTITLE THEN
  1615. BEGIN
  1616. IF TOPF(FILE)+1 EQ BOTF(FILE) THEN GENLITERAL(POS," EMPTY$");
  1617. ELSE
  1618. BEGIN
  1619. IF TOPS(SPLIT)+1 NQ BOTS(SPLIT) THEN
  1620. BEGIN
  1621. GENLITERAL(POS,"LINES $");
  1622. GENDECIMAL(POS,TOPS(SPLIT)+1-TOPF(FILNUM));
  1623. GENLITERAL(POS," - $");
  1624. GENDECIMAL(POS,BOTS(SPLIT)-1-TOPF(FILNUM));
  1625. END
  1626. GENLITERAL(POS," SIZE $");
  1627. GENDECIMAL(POS,BOTF(FILE)-1-TOPF(FILE));
  1628. END
  1629. IF XSHIFT[SPLIT] NQ 0 THEN
  1630. BEGIN # IF SET VIEW OFFSET ENABLED #
  1631. GENLITERAL(POS," OFFSET $");
  1632. GENDECIMAL(POS,XSHIFT[SPLIT]+1);
  1633. END
  1634. IF FILENAM[1] EQ FILENAM[2] THEN
  1635. BEGIN # IF SAME FILE IN BOTH SPLITS #
  1636. CHANGED[1] = CHANGED[1] LOR CHANGED[2];
  1637. CHANGED[2] = CHANGED[1];
  1638. END
  1639. IF CHANGED[SPLIT] NQ 0 THEN
  1640. BEGIN # IF FILE HAS BEEN CHANGED #
  1641. GENLITERAL(POS," (CHANGED)$");
  1642. END
  1643. ELSE
  1644. BEGIN # NO CHANGE #
  1645. IF LOCKED[SPLIT] NQ 0 THEN
  1646. BEGIN # IF FILE IS LOCKED #
  1647. GENLITERAL(POS," (READ-ONLY)$");
  1648. END
  1649. ELSE
  1650. BEGIN # NO LOCK #
  1651. GENLITERAL(POS," (NO CHANGES)$");
  1652. END
  1653. END
  1654. IF NUMMARKS GR 0 AND MRKFILE[0] EQ FDLF(FILE) THEN
  1655. BEGIN
  1656. IF NUMMARKS EQ 1 THEN
  1657. GENLITERAL(POS," <MARK ACTIVE>$");
  1658. ELSE
  1659. GENLITERAL(POS," <MARKS ACTIVE>$");
  1660. END
  1661. END
  1662. FOR POS = POS STEP 1 UNTIL(VTXMAX - ATTCOUNT) DO
  1663. BEGIN # UNTIL END OF LINE #
  1664. SETCHAR(TTYLINE,POS,CBLANK);
  1665. END
  1666. SETCHAR(TTYLINE,POS,CENDLINE);
  1667.  
  1668. END # GENTITLE #
  1669.  
  1670.  
  1671.  
  1672.  
  1673. # MAIN PAINTSCREEN CODE STARTS HERE #
  1674.  
  1675. IF NOT PROMPTING THEN
  1676. BEGIN
  1677.  
  1678. IF FORCEAUTOP[0] THEN
  1679. BEGIN # IF AUTO HALF PAGE #
  1680. TOPS(CURSPLIT) = BOTS(CURSPLIT) - NUMROWS[CURSPLIT] / 2;
  1681. SETTOPS(CURSPLIT);
  1682. XCURSOR = 0;
  1683. YCURSOR = BOTS(CURSPLIT);
  1684. YCURSOR = LTOY(YCURSOR,CURSPLIT);
  1685. SETBOTS(CURSPLIT);
  1686. PAINTSPLIT;
  1687. END
  1688. FORCEAUTOP[0] = FALSE;
  1689.  
  1690. # DETERMINE WHETHER RESIDUAL CURSOR IS OUT OF TEXT AREAS #
  1691.  
  1692. SCRNPT2=0;
  1693. IF YCURSOR LS 0 OR YCURSOR GR VTYMAX THEN SCRNPT2=1;
  1694. IF SCRNPT2 EQ 0 THEN
  1695. BEGIN
  1696. IF ROWTYPE[YCURSOR] NQ ROWST"TEXT"
  1697. AND ROWTYPE[YCURSOR] NQ ROWST"COMMAND" THEN SCRNPT2=1;
  1698. END
  1699.  
  1700. # VERIFY VALIDITY OF SCREEN BOUNDS, MAKE GOOD CURSOR POSITION #
  1701.  
  1702. IF SCRNPT2 EQ 0 THEN
  1703. BEGIN # SIMPLY VERIFY SCREEN BOUNDS #
  1704. SETTOPBOTS(1);
  1705. IF SPLITFILE[2] NQ 0 THEN SETTOPBOTS(2);
  1706. END
  1707. ELSE
  1708. BEGIN # RECOMPUTE CURSOR WHEN OFF TEXT #
  1709. IF SPLITFILE[2] EQ 0 THEN CURFILE=SPLITFILE[1];
  1710. CURSPLIT=MIN(MAX(CURSPLIT,1),2);
  1711. IF SPLITFILE[CURSPLIT] NQ CURFILE
  1712. THEN CURSPLIT=CURSPLIT LXR 3;
  1713. IF SPLITFILE[2] NQ 0
  1714. AND FDLF(SPLITFILE[1]) EQ FDLF(SPLITFILE[2]) THEN
  1715. BEGIN
  1716. SETTOPBOTS(CURSPLIT);
  1717. YCURSOR=CURF(CURFILE);
  1718. YCURSOR=LTOY(YCURSOR,CURSPLIT);
  1719. IF ROWTYPE[YCURSOR] EQ ROWST"TITLE" AND NUMROWS[CURSPLIT]
  1720. GR 0 THEN YCURSOR=YCURSOR+1;
  1721. END
  1722. ELSE
  1723. BEGIN
  1724. FOR SCRNPT1=1 STEP 1 UNTIL 2 DO
  1725. BEGIN
  1726. IF SPLITFILE[SCRNPT1] NQ 0 THEN
  1727. BEGIN
  1728. SETTOPBOTS(SCRNPT1);
  1729. IF SPLITFILE[SCRNPT1] EQ CURFILE THEN
  1730. BEGIN
  1731. YCURSOR=CURF(CURFILE);
  1732. YCURSOR=LTOY(YCURSOR,SCRNPT1);
  1733. IF ROWTYPE[YCURSOR] EQ ROWST"TITLE" AND
  1734. NUMROWS[SCRNPT1] GR 0 THEN YCURSOR=YCURSOR+1;
  1735. CURSPLIT=SCRNPT1;
  1736. END
  1737. END
  1738. END
  1739. END
  1740. END
  1741. IF FORCEAUTOR[0] THEN
  1742. BEGIN # IF FORCED TO NEXT LINE #
  1743. XCURSOR = 0;
  1744. YCURSOR = YCURSOR + 1;
  1745. FORCEAUTOR[0] = FALSE;
  1746. END
  1747. IF YCURSOR LS 0 OR YCURSOR GR VTYMAX THEN YCURSOR=COMMANDROW;
  1748.  
  1749. # SEE IF LAST TITLE NOW OBSOLETE #
  1750.  
  1751. GENTITLE(1);
  1752. SCRNPT4=MAX(LENGTH(TITLE1LIN),LENGTH(TTYLIN));
  1753. FOR SCRNPT1=0 STEP 1 UNTIL SCRNPT4 DO
  1754. BEGIN
  1755. GETCHAR(TITLE1LINE,SCRNPT1,SCRNPT2);
  1756. GETCHAR(TTYLINE,SCRNPT1,SCRNPT3);
  1757. IF SCRNPT2 NQ SCRNPT3 THEN ROWPAINT[TITLEROW[1]]=TRUE;
  1758. END
  1759. IF SPLITFILE[2] NQ 0 THEN
  1760. BEGIN
  1761. GENTITLE(2);
  1762. SCRNPT4=MAX(LENGTH(TITLE2LIN),LENGTH(TTYLIN));
  1763. FOR SCRNPT1=0 STEP 1 UNTIL SCRNPT4 DO
  1764. BEGIN
  1765. GETCHAR(TITLE2LINE,SCRNPT1,SCRNPT2);
  1766. GETCHAR(TTYLINE,SCRNPT1,SCRNPT3);
  1767. IF SCRNPT2 NQ SCRNPT3 THEN ROWPAINT[TITLEROW[2]]=TRUE;
  1768. END
  1769. END
  1770. FOR SPLIT=1 STEP 1 UNTIL 2 DO
  1771. BEGIN
  1772. FILNUM=SPLITFILE[SPLIT];
  1773. IF FILNUM NQ 0 THEN
  1774. BEGIN
  1775. IF LTPS(SPLIT) NQ TOPS(SPLIT)
  1776. OR LASTNAME[SPLIT] NQ FILENAM[FILNUM] THEN
  1777. BEGIN
  1778. PAINTONESPLT(SPLIT);
  1779. END
  1780. END
  1781. END
  1782. END
  1783.  
  1784. PAINTMARKS(2);
  1785.  
  1786. FOR SCRNPT1=0 STEP 1 UNTIL USRNUMLIN DO
  1787. BEGIN
  1788. IF ROWPAINT[SCRNPT1] OR ROWORIG[SCRNPT1] NQ SCRNPT1 THEN
  1789. BEGIN
  1790. ROWPAINT[SCRNPT1]=FALSE;
  1791. ROWORIG[SCRNPT1]=SCRNPT1;
  1792. GOTO PAINTSW[ROWTYPE[SCRNPT1]];
  1793.  
  1794. PTTEXT:
  1795. IF ROWPMARK[SCRNPT1] THEN
  1796. BEGIN # IF ONLY LOGICALLY MARKED #
  1797. IF NUMMARKS EQ 0 THEN ROWPMARK[SCRNPT1] = FALSE;
  1798. END
  1799. CONTROL IFEQ MULTI,1; # IF MULTI USER FSE #
  1800. VDTPOS(0,SCRNPT1); # POSITION #
  1801. CONTROL FI; # END OF IF MULTI #
  1802. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  1803. IF TABLOCKMDE[0] THEN
  1804. BEGIN # IF BLOCK MODE TERMINAL #
  1805. VDTSAP(DUMB,0,SCRNPT1); # SET ATTRIBUTE POSITION #
  1806. END
  1807. ELSE
  1808. BEGIN # NOT BLOCK MODE #
  1809. VDTPOS(0,SCRNPT1); # POSITION #
  1810. END
  1811. CONTROL FI; # END OF NOT MULTI #
  1812. SPLIT=ROWSPLIT[SCRNPT1];
  1813. SCRNPT2=YTOL(SCRNPT1,SPLIT);
  1814. IF VTCLRFRST[0] THEN VDTCLL(0,SCRNPT1);
  1815. SCRNPT6=XSHIFT[SPLIT]-1; # PRESET COLUMN LENGTH #
  1816. IF SCRNPT2 LS BOTS(SPLIT) THEN
  1817. BEGIN
  1818. POSZ(SCRNPT2);
  1819. SCRNPT6=LENGTH(LIN);
  1820. IF SCRNPT6 GR NUMWIDBLK+WIDTH AND ERRSTRING EQ " $" THEN
  1821. BEGIN
  1822. ERRSTRING="WIDE LINE$";
  1823. YCURSOR=SCRNPT1;
  1824. END
  1825. IF USRNUMCOL+XSHIFT[SPLIT] LS SCRNPT6 AND NOT ROWPMARK[SCRNPT1]
  1826. THEN
  1827. BEGIN
  1828. SETCHAR(LINE,USRNUMCOL+XSHIFT[SPLIT]+1,CENDLINE);
  1829. TRIMPAD;
  1830. SCRNPT6=LENGTH(LIN);
  1831. END
  1832. IF ROWCOLUM[SCRNPT1] THEN
  1833. BEGIN
  1834. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  1835. IF TABLOCKMDE[0] THEN VDTSAM(0);
  1836. CONTROL FI;
  1837. ROWCOLUM[SCRNPT1] = FALSE;
  1838. SCRNPT6 = 1;
  1839. FOR SCRNPT4 = XSHIFT[SPLIT] STEP 1 UNTIL
  1840. XSHIFT[SPLIT] + USRNUMCOL DO
  1841. BEGIN
  1842. SCRNPT5 = MOD(SCRNPT4+1,10) + CDIGIT0;
  1843. CONTROL IFEQ MULTI,1; # IF MULTI USER FSE #
  1844. IF SCRNPT5 EQ CDIGIT1 AND NOT TABATTRCHR[0] THEN
  1845. CONTROL FI; # END OF IF MULTI #
  1846. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  1847. IF SCRNPT5 EQ CDIGIT1 AND NOT TABATTRCHR[0]
  1848. AND NOT TABLOCKMDE[0] THEN
  1849. CONTROL FI; # END OF IF NOT MULTI #
  1850. BEGIN
  1851. SCRNPT6 = SCRNPT6 LXR 1;
  1852. IF SCRNPT6 EQ 0 THEN
  1853. BEGIN
  1854. VDTSAM(0);
  1855. END
  1856. ELSE
  1857. BEGIN
  1858. VDTSAM(MSKINVERSE);
  1859. END
  1860. END
  1861. SCRNPT5 = XLTINTXP[SCRNPT5];
  1862. VDTCHR(SCRNPT5);
  1863. END
  1864. CONTROL IFEQ MULTI,1; # IF MULTI USER FSE #
  1865. IF SCRNPT6 EQ 1 AND NOT TABATTRCHR[0] THEN VDTSAM(0);
  1866. CONTROL FI; # END OF IF MULTI #
  1867. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  1868. IF SCRNPT6 EQ 1 AND NOT TABATTRCHR[0] AND NOT TABLOCKMDE[0]
  1869. THEN VDTSAM(0);
  1870. CONTROL FI; # END OF IF NOT MULTI #
  1871. GOTO PTDONE; # FINISHED WITH THIS LINE #
  1872. END
  1873. ELSE IF ROWPMARK[SCRNPT1] THEN
  1874. BEGIN
  1875. IF SCRNPT6 EQ 0 THEN
  1876. BEGIN
  1877. LINE[0]=BLANKLIN;
  1878. SCRNPT6=LENGTH(LIN);
  1879. END
  1880. SCRNPT4=XSHIFT[SPLIT];
  1881. SCRNPT5=MIN(SCRNPT6-1,USRNUMCOL+XSHIFT[SPLIT]);
  1882. SCRNPT2 = SCRNPT4; # SAVE DEFAULT VALUES #
  1883. SCRNPT3 = SCRNPT5;
  1884. IF CURRENT EQ REGLINE[MARKREG] AND MRKCHAR[0]
  1885. GQ 0 THEN SCRNPT4=MAX(MRKCHAR[0],XSHIFT[SPLIT]);
  1886. IF CURRENT EQ REGLINE[MARKREG+1] AND MRKCHAR[1]
  1887. GQ 0 THEN SCRNPT5=MIN(MRKCHAR[1],SCRNPT5);
  1888. IF SCRNPT4 GR SCRNPT5 THEN
  1889. BEGIN # IF BEYOND MARKED AREA #
  1890. SCRNPT4 = - 1;
  1891. SCRNPT5 = - 1;
  1892. END
  1893. IF TABLOCKMDE[0] THEN
  1894. BEGIN # IF BLOCK MODE TYPE TERMINAL #
  1895. IF (SCRNPT2 EQ SCRNPT4) AND (SCRNPT3 EQ SCRNPT5) THEN
  1896. BEGIN # IF MARKING #
  1897. VDTSAM(MSKINVERSE);
  1898. END
  1899. ELSE
  1900. BEGIN # NOT MARKING #
  1901. VDTSAM(0);
  1902. END
  1903. END
  1904. SCRNPT6=MIN(SCRNPT6-1,USRNUMCOL+XSHIFT[SPLIT]);
  1905. FOR SCRNPT2=XSHIFT[SPLIT] STEP 1 UNTIL SCRNPT6 DO
  1906. BEGIN
  1907. IF SCRNPT2 EQ SCRNPT4 AND NOT TABLOCKMDE[0] THEN
  1908. BEGIN
  1909. IF TABATTRCHR[0] THEN
  1910. BEGIN # IF ATTRIBUTE TAKES A SPACE #
  1911. IF TABNOTCHAR[0] AND SCRNPT2 EQ XSHIFT[SPLIT]
  1912. AND SCRNPT2 NQ SCRNPT5 THEN
  1913. BEGIN # IF A CHARACTER MUST BE SKIPPED #
  1914. SCRNPT2 = SCRNPT2 + 1;
  1915. END
  1916. ELSE
  1917. BEGIN # MOVE CURSOR BACK FOR ATTRIBUTE #
  1918. VDTOUT(X"08");
  1919. END
  1920. END
  1921. VDTSAM(MSKINVERSE);
  1922. END
  1923. GETCHAR(LINE,SCRNPT2,SCRNPT3);
  1924. SCRNPT3=XLTINTXP[SCRNPT3];
  1925. IF SCRNPT3 LS O"4040" THEN SCRNPT3 = XLTINTXP[UNPRINT];
  1926. VDTCHR(SCRNPT3);
  1927. IF SCRNPT2 EQ SCRNPT5 AND NOT TABLOCKMDE[0] THEN
  1928. BEGIN
  1929. IF TABATTRCHR[0] THEN
  1930. BEGIN # IF ATTRIBUTE TAKES A BYTE #
  1931. IF SCRNPT2 EQ VTXMAX THEN
  1932. BEGIN # IF AT END OF CURRENT LINE #
  1933. VDTOUT(X"08"); # CURSOR MUST MOVE BACK #
  1934. END
  1935. ELSE
  1936. BEGIN # SKIP AN OUTPUT CHARACTER #
  1937. IF SCRNPT2 NQ SCRNPT6 THEN SCRNPT2 = SCRNPT2 + 1;
  1938. END
  1939. END
  1940. VDTSAM(0);
  1941. END
  1942. END
  1943. ROWPMARK[SCRNPT1]=FALSE;
  1944. END
  1945. ELSE
  1946. BEGIN # ALL TEXT THAT FITS WINDOW #
  1947. IF TABATTRCHR[0] THEN
  1948. BEGIN # IF ATTRIBUTE TAKES A BYTE #
  1949. IF ROWTYPE[SCRNPT1-1] EQ ROWST"TITLE" THEN
  1950. BEGIN # IF FIRST LINE AFTER TITLE #
  1951. VDTPOS(VTXMAX,SCRNPT1-1);
  1952. ATTRIBMASK = MSKINVERSE;
  1953. END
  1954. END
  1955. VDTSAM(0); # CLEAR ATTRIBUTES #
  1956. SCRNPT6=MIN(SCRNPT6-1,USRNUMCOL+XSHIFT[SPLIT]);
  1957. SCRNPT4 = -1; # NUMBER OF BLANKS SO FAR, - 1 #
  1958. FOR SCRNPT2=XSHIFT[SPLIT] STEP 1 UNTIL SCRNPT6 DO
  1959. BEGIN
  1960. GETCHAR(LINE,SCRNPT2,SCRNPT3);
  1961. IF VTCLRFRST[0] AND SCRNPT3 EQ CBLANK THEN
  1962. BEGIN # IF LINE CLEAR, CHAR. A BLANK #
  1963. SCRNPT4 = SCRNPT4 + 1;
  1964. END
  1965. ELSE
  1966. BEGIN # NOT A BLANK, OR NO CLEAR LINE #
  1967. IF SCRNPT4 GQ 0 THEN
  1968. BEGIN # IF SOME BLANKS HAVE BEEN SEEN #
  1969. IF SCRNPT4 GQ VTNUMBLNK[0] THEN
  1970. BEGIN # IF AT OR PAST THRESHOLD #
  1971. VDTPOS(SCRNPT2-XSHIFT[SPLIT],SCRNPT1);
  1972. END
  1973. ELSE
  1974. BEGIN # NOT WORTH VDTPOS #
  1975. SCRNPT5 = XLTINTXP[CBLANK];
  1976. FOR SCRNPT4 = SCRNPT4 STEP -1 UNTIL 0 DO
  1977. BEGIN # SEND BLANKS #
  1978. VDTCHR(SCRNPT5);
  1979. END
  1980. END
  1981. SCRNPT4 = -1; # RESET BLANK COUNT #
  1982. END
  1983. SCRNPT3 = XLTINTXP[SCRNPT3];
  1984. IF SCRNPT3 LS O"4040" THEN SCRNPT3 = XLTINTXP[UNPRINT];
  1985. VDTCHR(SCRNPT3);
  1986. END
  1987. END
  1988. END
  1989. END
  1990. ELSE
  1991. BEGIN
  1992. VDTSAM(0); # CLEAR ATTRIBUTES #
  1993. ROWPMARK[SCRNPT1] = FALSE;
  1994. END
  1995. SCRNPT6=SCRNPT6-XSHIFT[SPLIT]+1;
  1996. SCRNPT6=MAX(SCRNPT6,0);
  1997. IF SCRNPT6 LQ VTXMAX AND # IF NOT CLEARED (AT PTTEXT)#
  1998. NOT VTCLRFRST[0] THEN # BEFORE PRINTING OR BY THE #
  1999. VDTCLL(SCRNPT6,SCRNPT1); # ACTUAL PRINTING OF OUTPUT #
  2000. GOTO PTDONE;
  2001.  
  2002. PTTITLE:
  2003. SPLIT=ROWSPLIT[SCRNPT1];
  2004. FILNUM=SPLITFILE[SPLIT];
  2005. IF TABLOCKMDE[0] THEN
  2006. BEGIN # IF NOT CHARACTER MODE #
  2007. SCRNPT6 = 1; # WRITE TITLE LINE #
  2008. VDTSAP(DUMB,0,SCRNPT1);
  2009. VDTSAM(MSKPROTECT+MSKUNDERLN);
  2010. END
  2011. ELSE
  2012. BEGIN # CHARACTER MODE TERMINAL #
  2013. SCRNPT6 = 0; # NO CHANGE YET TO TITLE LINE #
  2014. END
  2015. GENTITLE(SPLIT);
  2016. SCRNPT5=LENGTH(TTYLIN);
  2017. IF TABATTRCHR[0] THEN SCRNPT5 = SCRNPT5 - 3;
  2018. IF SPLIT EQ 1 THEN
  2019. BEGIN # IF TOP SPLIT #
  2020. FOR SCRNPT2=LENGTH(TITLE1LIN) STEP 1 UNTIL SCRNPT5 DO
  2021. BEGIN
  2022. SETCHAR(TITLE1LINE,SCRNPT2,CENDLINE);
  2023. END
  2024. END
  2025. ELSE # IF BOTTOM SPLIT #
  2026. BEGIN
  2027. FOR SCRNPT2=LENGTH(TITLE2LIN) STEP 1 UNTIL SCRNPT5 DO
  2028. BEGIN
  2029. SETCHAR(TITLE2LINE,SCRNPT2,CENDLINE);
  2030. END
  2031. END
  2032. SCRNPT2 = 0;
  2033. IF TABATTRCHR[0] THEN SCRNPT2 = 1;
  2034. FOR SCRNPT2 = SCRNPT2 STEP 1 UNTIL SCRNPT5 DO
  2035. BEGIN # UNTIL DONE FOR TITLE LINE #
  2036. IF SPLIT EQ 1 THEN GETCHAR(TITLE1LINE,SCRNPT2,SCRNPT3);
  2037. ELSE GETCHAR(TITLE2LINE,SCRNPT2,SCRNPT3);
  2038. GETCHAR(TTYLINE,SCRNPT2,SCRNPT4);
  2039. IF SCRNPT3 NQ SCRNPT4 AND SCRNPT4 NQ CENDLINE THEN
  2040. BEGIN # IF CHARACTER HAS CHANGED #
  2041. SCRNPT4=XLTINTXP[SCRNPT4];
  2042. IF SCRNPT6 EQ 0 THEN
  2043. BEGIN # IF FIRST CHANGE (CHAR. MODE) #
  2044. IF TABNOTCHAR[0] THEN
  2045. BEGIN # IF ATTRIBUTE IS "EMBEDDED" #
  2046. VDTPOS(0,SCRNPT1);
  2047. END
  2048. ELSE
  2049. BEGIN # ATTRIBUTE WILL NOT OVERWRITE #
  2050. VDTPOS(SCRNPT2,SCRNPT1);
  2051. END
  2052. IF TABVTPROTM[0] THEN
  2053. BEGIN # IF PROTECT AVAILABLE FOR FSE #
  2054. VDTSAM(MSKPROTECT+MSKUNDERLN);
  2055. END
  2056. ELSE
  2057. BEGIN # NO PROTECT #
  2058. VDTSAM(MSKUNDERLN);
  2059. END
  2060. IF TABNOTCHAR[0] THEN
  2061. BEGIN # IF ATTRIBUTE IS "EMBEDDED" #
  2062. VDTPOS(SCRNPT2,SCRNPT1);
  2063. END
  2064. SCRNPT6 = 1;
  2065. END
  2066. ELSE
  2067. BEGIN # NOT FIRST CHANGED CHARACTER #
  2068. IF SCRNPT2 NQ VTXCUR THEN VDTPOS(SCRNPT2,SCRNPT1);
  2069. END
  2070. VDTCHR(SCRNPT4);
  2071. END
  2072. END
  2073. IF NOT TABLOCKMDE[0] THEN
  2074. BEGIN # IF CHARACTER MODE TERMINAL #
  2075. IF SCRNPT6 EQ 1 THEN
  2076. BEGIN # IF CHANGE MADE TO TITLE LINE #
  2077. IF TABNOTCHAR[0] AND TABATTRCHR[0] THEN
  2078. BEGIN # IF ATTRIBUTE TAKES SPACE #
  2079. VDTPOS(VTXMAX-1,SCRNPT1);
  2080. END
  2081. ELSE
  2082. BEGIN # IF ATTRIBUTE TAKES NO SPACE #
  2083. VDTPOS(VTXMAX,SCRNPT1);
  2084. END
  2085. VDTSAM(0);
  2086. SCRNPT6 = 0;
  2087. END
  2088. END
  2089. ATTRIBMASK[0] = 0; # CLEAR MASK #
  2090. FOR SCRNPT2 = 0 STEP 1 UNTIL TTLLNLEN DO
  2091. BEGIN
  2092. IF SPLIT EQ 1 THEN TITLE1LINE[SCRNPT2]=TTYLINE[SCRNPT2];
  2093. ELSE TITLE2LINE[SCRNPT2]=TTYLINE[SCRNPT2];
  2094. END
  2095. LTPS(SPLIT)=TOPS(SPLIT);
  2096. LASTNAME[SPLIT]=FILENAM[FILNUM];
  2097. GOTO PTDONE;
  2098.  
  2099. PTLABEL:
  2100. VDTSAP(DUMB,0,SCRNPT1); # SET ATTR POSITION #
  2101. IF NOT TABLOCKMDE[0] THEN
  2102. BEGIN # IF NOT BLOCK MODE #
  2103. VDTCLL(0,SCRNPT1); # CLEAR LINE #
  2104. END
  2105. IF TABVTPROTM[0] THEN VDTSAM(MSKPROTECT);
  2106. SCRNPT3=1;
  2107. IF SHIFTFKEY NQ 0 AND (SCRNPT1 EQ FKEYROW OR SCRNPT1 EQ FKEYROW+3
  2108. OR SCRNPT1 EQ FKEYROW+6) THEN SCRNPT3 = -1;
  2109. IF SCRNPT1 LS FKEYROW+1+SHIFTFKEY THEN SCRNPT4 = 0;
  2110. ELSE IF SCRNPT1 LS FKEYROW+2*(2+SHIFTFKEY)-1 THEN
  2111. SCRNPT4 = FKEYSHOW;
  2112. ELSE SCRNPT4 = FKEYSHOW+FKEYSHOW;
  2113. FOR SCRNPT2=1 STEP 1 WHILE SCRNPT2 LQ FKEYSHOW
  2114. AND SCRNPT1 NQ FKEYROW+1+SHIFTFKEY
  2115. AND SCRNPT1 NQ FKEYROW+2*(2+SHIFTFKEY)-1 DO
  2116. BEGIN
  2117. SCRNPT5 = FKEYNUMS[SCRNPT2+SCRNPT4];
  2118. IF SCRNPT5 EQ 0 THEN SCRNPT3 = -1;
  2119. IF SCRNPT3 GQ 0 THEN
  2120. BEGIN
  2121. IF SCRNPT5 LS 10 THEN TTSTR("F$");
  2122. TTDEC(SCRNPT5);
  2123. TTSTR(FKEYSPC1); # " $" OR "$" #
  2124. END
  2125. ELSE TTSTR(FKEYSPC2); # " $" OR " $" #
  2126. IF TABVTPROTM[0] THEN
  2127. BEGIN # IF PROTECT AVAILABLE FOR FSE #
  2128. VDTSAM(MSKPROTECT+MSKINVERSE);
  2129. END
  2130. ELSE
  2131. BEGIN # NO PROTECT #
  2132. VDTSAM(MSKINVERSE);
  2133. END
  2134. IF FKEYPAD GR 0 THEN TTST(" ",FKEYPAD);
  2135. TTST(FKEYNAME[SCRNPT5*SCRNPT3],FKEYCHARS);
  2136. IF FKEYPAD GR 0 THEN TTST(" ",FKEYPAD);
  2137. IF SCRNPT2 NQ FKEYSHOW THEN
  2138. BEGIN # IF NOT FKEYSHOW #
  2139. IF TABVTPROTM[0] THEN
  2140. BEGIN # IF PROTECT AVAILABLE FOR FSE #
  2141. VDTSAM(MSKPROTECT);
  2142. END
  2143. ELSE
  2144. BEGIN # NO PROTECT #
  2145. VDTSAM(0);
  2146. END
  2147. TTSTR(FKEYSPC1); # " $" OR "$" #
  2148. END
  2149. END
  2150. IF NOT TABLOCKMDE[0] THEN
  2151. BEGIN # IF CHARACTER MODE TERMINAL #
  2152. IF NOT(TABATTRCHR[0] AND TABLASTPOS[0] EQ CURSORMOVE"SCROLL"
  2153. AND VTYCUR EQ VTYMAX) THEN VDTSAM(0);
  2154. END
  2155. ELSE
  2156. BEGIN # IF BLOCK MODE TERMINAL #
  2157. IF SCRNPT1 EQ FKEYROW+1+SHIFTFKEY
  2158. OR SCRNPT1 EQ FKEYROW+2*(2+SHIFTFKEY)-1 THEN
  2159. VDTCLL(0,SCRNPT1);
  2160. END
  2161. ATTRIBMASK[0] = 0; # CLEAR MASK #
  2162. GOTO PTDONE;
  2163.  
  2164. PTEMPTY:
  2165. VDTSAP(DUMB,0,SCRNPT1); # SET UP AN ATTR BYTE #
  2166. VDTSAM(0);
  2167. VDTCLL(0,SCRNPT1);
  2168. GOTO PTDONE;
  2169.  
  2170. PTCMD:
  2171. VDTSAP(DUMB,0,COMMANDROW); # SET UP AN ATTR BYTE #
  2172. VDTSAM(0);
  2173. VDTCLL(0,COMMANDROW);
  2174. GOTO PTDONE;
  2175.  
  2176. PTRESPONSE:
  2177. VDTSAP(DUMB,0,RESPONSEROW); # SET ATTRIBUTE POSITION #
  2178. IF TABLOCKMDE[0] THEN VDTSAM(MSKPROTECT);
  2179. VDTCLL(0,RESPONSEROW);
  2180. ATTRIBMASK[0] = 0;
  2181. # FALL THROUGH TO PTDONE #
  2182. PTDONE:
  2183.  
  2184. END
  2185. END
  2186.  
  2187. IF ERRCURSOR GQ 0 THEN
  2188. BEGIN
  2189. XCURSOR=ERRCURSOR;
  2190. IF YCURSOR EQ COMMANDROW THEN
  2191. BEGIN # IF COMMAND ROW #
  2192. IF TABLOCKMDE[0] THEN
  2193. BEGIN # SET ATTRIBUTE #
  2194. VDTSAP(DUMB,0,COMMANDROW);
  2195. VDTSAM(0);
  2196. END
  2197. VDTCLL(0,COMMANDROW);
  2198. FOR SCRNPT2 = 0 STEP 1 UNTIL LENGTH(CMDLIN) - 1 DO
  2199. BEGIN # WRITE COMMAND #
  2200. GETCHAR(CMDLINE,SCRNPT2,SCRNPT3);
  2201. VDTCHR(XLTINTXP[SCRNPT3]);
  2202. END
  2203. ROWPAINT[COMMANDROW]=TRUE;
  2204. END
  2205. END
  2206. ELSE
  2207. BEGIN # NO NEED TO PAINT #
  2208. IF TABLOCKMDE[0] THEN
  2209. BEGIN # INSURE ATTRIBUTE #
  2210. VDTSAP(DUMB,0,COMMANDROW);
  2211. VDTSAM(0);
  2212. END
  2213. END
  2214.  
  2215. IF ERRSTRING NQ " $" THEN
  2216. BEGIN
  2217. VDTSAP(DUMB,0,RESPONSEROW);
  2218. IF TABLOCKMDE[0] THEN VDTSAM(MSKPROTECT);
  2219. VDTCLL(0,RESPONSEROW);
  2220. TTSTR(ERRSTRING);
  2221. ATTRIBMASK[0] = 0;
  2222. ROWPAINT[RESPONSEROW]=TRUE;
  2223. END
  2224.  
  2225. POSZ(CURF(CURFILE));
  2226. IF XCURSOR LS 0 THEN XCURSOR=0;
  2227. IF XCURSOR GR USRNUMCOL THEN
  2228. BEGIN # IF CURSOR OFF EDGE OF SCREEN #
  2229. XCURSOR=0;
  2230. IF ERRSTRING EQ " $" THEN
  2231. BEGIN # IF NO OTHER ERROR MESSAGE #
  2232. ERRSTRING = "CURSOR RESET FROM BEYOND EDGE OF SCREEN$";
  2233. CONTROL IFEQ SINGLE,1; # IF NOT MULTI USER FSE #
  2234. IF TABLOCKMDE[0] THEN
  2235. BEGIN
  2236. VDTSAP(DUMB,0,RESPONSEROW);
  2237. VDTSAM(MSKPROTECT);
  2238. END
  2239. CONTROL FI; # END OF NOT MULTI USER FSE #
  2240. VDTCLL(0,RESPONSEROW);
  2241. TTSTR(ERRSTRING);
  2242. ATTRIBMASK[0] = 0;
  2243. ROWPAINT[RESPONSEROW]=TRUE;
  2244. END
  2245. END
  2246. VDTPOS(XCURSOR,YCURSOR);
  2247.  
  2248. IOEND # PAINTSCREEN #
  2249. PAGE # GLOBAL LOCATE/CHANGE PROMPT #
  2250.  
  2251.  
  2252. PROC GLOBALPROMPT;
  2253. IOBEGIN(GLOBALPROMPT)
  2254. #
  2255. ** GLOBALPROMPT - ASK QUESTION FOR GLOBAL OPERATIONS.
  2256. *
  2257. * THIS ROUTINE PROVIDES SCREEN FORMATTING AND INTERACTIVE
  2258. * DIALOGUE FOR THE GENERAL CATEGORY OF GLOBAL SEARCH AND
  2259. * GLOBAL CHANGES. THESE FUNCTIONS REQUIRE INTERMITTENT
  2260. * CALLS TO A SCREEN DRIVER WHILE PROCESSING A FILE. THE
  2261. * ACTUAL PROCESSING CODE INTERFACES TO EITHER GLOBALLOCATE
  2262. * OR GLOBALCHANGE. THESE ROUTINES PERFORM PRELIMINARY
  2263. * OPERATIONS AND THEN PASS THE CALL TO THIS ROUTINE. THEN
  2264. * THE INTERFACE ROUTINE ANALYZES THE USERS REPLY.
  2265. *
  2266. * GLOBALPROMPT HAS THREE BASIC FUNCTIONS. FIRST, IT DOES
  2267. * INITIAL SCREEN FORMATTING ON THE FIRST CALL OF THE GLOBAL
  2268. * OPERATION OR THE FIRST CALL AFTER A DIALOGUE. SECOND, IT
  2269. * DISPLAYS EACH LINE OF TEXT AS THEY BECOME AVAILABLE.
  2270. * THIRD, WHEN THE DISPLAY IS FULL OR THE OPERATION IS ABOUT
  2271. * TO FINISH, GLOBALPROMPT PROMPTS THE USER FOR INSTRUCTIONS.
  2272. *
  2273. * ENTRY SCRNPT4 - ORDINAL OF PROMPT MESSAGE.
  2274. * SCREENMODE, PROMPTING - BOTH TRUE TO DO ANYTHING.
  2275. * ROWSUSED - AS INITIALIZED OR LEFT BY PREVIOUS CALL.
  2276. * LINCTR - INDICATES FINAL CALL OF GLOBAL OPERATION.
  2277. * CURRENT, CURSPLIT, CURFILE, TOPF() - WHERE WE ARE.
  2278. * COMMANDROW, TITLEROW[ALL], NUMROWS[ALL] - SETUP.
  2279. *
  2280. * EXIT SCRNPT5=1 IF PROMPT REALLY OCCURRED, ELSE 0.
  2281. * TTYLIN - POSSIBLY INPUT TEXT.
  2282. * TMPLIN - OLD VERSION OF TTYLIN IF TTYLIN CHANGED.
  2283. * ROWLNPTR[ALL] - INDICATE WHICH FILE LINE ON ROW.
  2284. * ROWUSED - UPDATED.
  2285. * ROWPAINT[THIS SPLIT] - TRUE.
  2286. * TITLE1LIN, TITLE2LIN - CLEARED.
  2287. *
  2288. * MACROS GETCHAR.
  2289. *
  2290. * CALLS VDTCLL, VDTPOS, TTLPAD, TTSTR, VDTCHR, PAINTNONE,
  2291. * COPYLIN, ASKUSER, PAINTSPLIT.
  2292. *
  2293. * USES P<FROM>, SCRNPT1, SCRNPT2, SCRNPT3, SCRNPT6.
  2294. #
  2295. ARRAY GLBLMSGS [1:4] S(8);
  2296. BEGIN
  2297. ITEM GLBLTITLE C(0,0,40) = [ "LOCATED LINES$",
  2298. "LOCATED LINES$", "CHANGED LINES$", "CHANGED LINES$" ];
  2299. ITEM GLBLPROMPT C(4,0,40) = [
  2300. "ENTER LINE NUMBER OR PRESS NEXT$",
  2301. "ENTER LINE NUMBER OR PRESS NEXT$",
  2302. "ENTER UNDO OR PRESS NEXT FOR MORE$",
  2303. "ENTER UNDO OR PRESS NEXT TO END$" ];
  2304. END
  2305.  
  2306. SCRNPT5=0;
  2307.  
  2308. IF NOT (SCREENMODE AND PROMPTING) THEN IORET
  2309.  
  2310. IF ROWSUSED EQ 0 THEN # INIT DISPLAY #
  2311. BEGIN
  2312. VDTCLL(0,COMMANDROW);
  2313. VDTCLL(0,RESPONSEROW);
  2314. TITLE1LINE[0]=NULLIN;
  2315. TITLE2LINE[0]=NULLIN;
  2316. FOR SCRNPT1=0 STEP 1 UNTIL VTYMAX DO ROWLNPTR[SCRNPT1]=0;
  2317. FOR SCRNPT1=TITLEROW[CURSPLIT] STEP 1 UNTIL
  2318. TITLEROW[CURSPLIT]+NUMROWS[CURSPLIT] DO VDTCLL(0,SCRNPT1);
  2319. VDTPOS(0,TITLEROW[CURSPLIT]);
  2320. TTSTR("F$");
  2321. TTLCSTR("ILE $");
  2322. TTLFN(FILENAM[SPLITFILE[CURSPLIT]]);
  2323. TTSTR(" D$");
  2324. TTLCSTR("ISPLAYING $");
  2325. P&lt;FROM>=LOC(GLBLTITLE[SCRNPT4]);
  2326. TTLCSTR(FROM);
  2327. END
  2328.  
  2329. IF LINCTR LS LARGENUM THEN # NOT FINAL CALL #
  2330. BEGIN
  2331. ROWSUSED=ROWSUSED+1;
  2332. # PRINT ONE TEXT LINE NEXT POSITION #
  2333. VDTPOS(0,TITLEROW[CURSPLIT]+ROWSUSED);
  2334. ROWLNPTR[TITLEROW[CURSPLIT]+ROWSUSED]=CURRENT-TOPF(CURFILE);
  2335. TTLPAD(CURRENT-TOPF(CURFILE),7," ");
  2336. TTSTR(" $");
  2337. SCRNPT6 = -1; # NUMBER OF BLANKS SO FAR, - 1 #
  2338. FOR SCRNPT1=0 STEP 1 UNTIL MIN(LENGTH(LIN)-1,VTXMAX-8) DO
  2339. BEGIN
  2340. GETCHAR(LINE,SCRNPT1,SCRNPT2);
  2341. IF SCRNPT2 EQ CBLANK THEN
  2342. BEGIN # IF CHARACTER IS A BLANK #
  2343. SCRNPT6 = SCRNPT6 + 1;
  2344. END
  2345. ELSE
  2346. BEGIN # NOT A BLANK #
  2347. IF SCRNPT6 GQ 0 THEN
  2348. BEGIN # IF SOME BLANKS HAVE BEEN SEEN #
  2349. IF SCRNPT6 GQ VTNUMBLNK[0] THEN
  2350. BEGIN # IF AT OR PAST THRESHOLD #
  2351. VDTPOS(SCRNPT1+8,VTYCUR);
  2352. END
  2353. ELSE
  2354. BEGIN # NOT WORTH VDTPOS #
  2355. SCRNPT3 = XLTINTXP[CBLANK];
  2356. FOR SCRNPT6 = SCRNPT6 STEP -1 UNTIL 0 DO
  2357. BEGIN # SEND BLANKS #
  2358. VDTCHR(SCRNPT3);
  2359. END
  2360. END
  2361. SCRNPT6 = -1; # RESET BLANK COUNT #
  2362. END
  2363. SCRNPT2 = XLTINTXP[SCRNPT2];
  2364. VDTCHR(SCRNPT2);
  2365. END
  2366. END
  2367. END
  2368.  
  2369. IF ROWSUSED LS NUMROWS[CURSPLIT] AND LINCTR LS LARGENUM
  2370. THEN IORET
  2371.  
  2372. PAINTNONE; # SUPPRESS PAINTSCREEN OUTPUT #
  2373. COPYLIN(TTYLIN,TMPLIN); # PRESERVE OLD TTYLIN #
  2374. P&lt;FROM>=LOC(GLBLPROMPT[SCRNPT4]);
  2375. ASKUSER(FROM,0);
  2376. PROMPTING=TRUE; # SINCE ASKUSER CLEARS #
  2377. PAINTSPLIT; # SO SCREEN WILL BE RE-BUILT #
  2378. SCRNPT5=1; # INDICATE PROMPT ON THIS CYCLE #
  2379. ROWSUSED=0; # INDICATE FRESH BATCH NEXT TIME #
  2380.  
  2381. IOEND # OF GLOBALPROMPT #
  2382.  
  2383.  
  2384. PROC GLOBALLOCATE;
  2385. IOBEGIN(GLOBALLOCATE)
  2386. #
  2387. ** GLOBALLOCATE - GLOBAL LOCATE PROMPTING INTERFACE.
  2388. *
  2389. * GLOBALLOCATE IS AN INTERFACE BETWEEN THE LOCATE
  2390. * COMMAND PROCESSING AND THE GLOBALPROMPT ROUTINE.
  2391. * GLOBAL SEARCHES DROP INTO A SECONDARY DISPLAY AND PROMPT.
  2392. * GLOBALLOCATE USES GLOBALPROMPT FOR CONTROL OVER THE
  2393. * DISPLAY AND USER'S REPLY, AND PERFORMS ITS OWN
  2394. * ANALYSIS OF REPLIES. GLOBALLOCATE CAN DIRECT THE COMMAND
  2395. * DRIVER TO SHUTDOWN THE SEARCH ON USER REQUEST.
  2396. *
  2397. * ENTRY LINCTR - INDICATES LAST CALL OF OPERATION.
  2398. * CURRENT, CURSPLIT, CURFILE, TOPF() - WHERE WE ARE.
  2399. *
  2400. * EXIT LINCTR=LARGENUM FOR USER-REQUESTED SHUTDOWN.
  2401. * CURRENT - POSSIBLY MOVED.
  2402. *
  2403. * MACROS GETCHAR.
  2404. *
  2405. * CALLS GLOBALPROMPT, WINDOLIN, POSZ.
  2406. *
  2407. * USES TTYLIN, SCRNPT4, SCRNPT5.
  2408. #
  2409. ITEM TMP1, TMP2, TMP3; # USE INSTANTLY #
  2410.  
  2411. SCRNPT4=1; # INDICATE MESSAGE SELECTION #
  2412. IF LINCTR EQ LARGENUM THEN SCRNPT4=2;
  2413. GLOBALPROMPT;
  2414. IF SCRNPT5 EQ 0 THEN IORET # IF NO REPLY YET #
  2415.  
  2416. # EXIT IMMEDIATELY IF USER ESCAPING WITH FKEY #
  2417. IF ESCAPE THEN IORET
  2418.  
  2419. TMP1=-1; # SEE IF NUMERIC REPLY #
  2420. FOR TMP2=0 STEP 1 UNTIL LENGTH(TTYLIN)-1 DO
  2421. BEGIN
  2422. GETCHAR(TTYLINE,TMP2,TMP3);
  2423. IF TMP3 GQ CDIGIT0 AND TMP3 LQ CDIGIT9 THEN
  2424. BEGIN
  2425. IF TMP1 LS 0 THEN TMP1=0;
  2426. TMP1=TMP1*10 + TMP3-CDIGIT0;
  2427. END
  2428. END
  2429.  
  2430. IF TMP1 LS 0 AND YCURSOR GR 0 AND ROWLNPTR[YCURSOR-1] NQ 0
  2431. THEN TMP1=ROWLNPTR[YCURSOR-1]; # IF CURSOR POINTED #
  2432.  
  2433. IF TMP1 GQ 0 THEN # STOP ON SIGNIFICANT REPLY #
  2434. BEGIN
  2435. LINCTR=LARGENUM; # TO STOP DORANGE #
  2436. TMP1=TMP1+TOPF(CURFILE);
  2437. WINDOLIN(TMP1,CURFILE);
  2438. POSZ(TMP1);
  2439. END
  2440.  
  2441. IOEND # OF GLOBALLOCATE #
  2442.  
  2443.  
  2444. PROC GLOBALCHANGE;
  2445. IOBEGIN(GLOBALCHANGE)
  2446. #
  2447. ** GLOBALCHANGE - GLOBAL CHANGE PROMPTING INTERFACE.
  2448. *
  2449. * ENTRY LINCTR - INDICATES LAST CALL OF OPERATION.
  2450. * CURRENT, CURSPLIT, CURFILE, TOPF() - WHERE WE ARE.
  2451. *
  2452. * EXIT LINCTR=LARGENUM FOR USER-REQUESTED SHUTDOWN.
  2453. * CMDLIN - POSSIBLY UNDO COMMAND.
  2454. *
  2455. * MACROS GETCHAR.
  2456. *
  2457. * CALLS GLOBALPROMPT, EXCHWD, DSPLCOD, STARTCMD.
  2458. *
  2459. * USES TMPLIN, SCRNPT4, SCRNPT5.
  2460. *
  2461. * NOTE TTYLIN USED WITH RESTORATION.
  2462. #
  2463.  
  2464. ITEM TMP1, TMP2, TMP3; # USE INSTANTLY #
  2465.  
  2466. IF NOT (SCREENMODE AND PROMPTING) THEN IORET # EFFICIENT #
  2467.  
  2468. SCRNPT4=3; # INDICATE MESSAGE SELECTION #
  2469. IF LINCTR EQ LARGENUM THEN SCRNPT4=4;
  2470. GLOBALPROMPT;
  2471. IF SCRNPT5 EQ 0 THEN IORET # LEAVE IF NO REPLY YET #
  2472.  
  2473. # GET OUT IF USER ESCAPING WITH FKEY #
  2474. IF ESCAPE THEN IORET
  2475.  
  2476. EXCHWD(BUFWIDP1,TTYLIN,TMPLIN); # TTYLIN AS WAS, TMPLIN=INPUT #
  2477. TMP1=-1; # SEARCH FOR ALPHABETIC REPLY #
  2478. FOR TMP2=0 STEP 1 UNTIL LENGTH(TMPLIN)-1 DO
  2479. BEGIN
  2480. GETCHAR(TMPLINE,TMP2,TMP3);
  2481. DSPLCOD(TMP3);
  2482. IF TMP1 LS 0 AND TMP3 GQ CLETTERA AND TMP3 LQ CLETTERZ
  2483. THEN TMP1=TMP3;
  2484. END
  2485. IF TMP1 EQ "U" THEN
  2486. BEGIN
  2487. LINCTR=LARGENUM; # TO STOP DORANGE #
  2488. SETCHAR(CMDLINE,0,CLETTERU); # CREATE UNDO COMMAND #
  2489. SETCHAR(CMDLINE,1,CENDLINE);
  2490. STARTCMD;
  2491. END
  2492.  
  2493. IOEND # OF GLOBALCHANGE #
  2494. PAGE # GENERAL LINE TO SCREEN DISPLAYS #
  2495.  
  2496. #
  2497. ** DEDICATED DISPLAY DRIVERS.
  2498. *
  2499. * BGNDSPLAY, ENDDSPLAY, AND EOLDSPLAY PROVIDE A GENERAL
  2500. * MECHANISM FOR COMMAND PROCESSORS IN THE EDITOR TO
  2501. * OVERRIDE THE NORMAL DISPLAY AND DISPLAY SPECIALIZED
  2502. * INFORMATION. AT THE CURRENT TIME, THESE ROUTINES ARE
  2503. * COMPILED ONLY IN THE SINGLE-USER VERSION OF THE EDITOR
  2504. * DUE TO THEIR LIMITED SCOPE OF NEED.
  2505. *
  2506. * THE CALLER USES BGNDSPLAY TO TAKE OVER THE SCREEN,
  2507. * THEN USES ANY OF THE FSEFORM ROUTINES TO FORMAT EACH
  2508. * LINE OF TEXT, CALLING EOLDSPLAY TO ADVANCE THE CURSOR
  2509. * BETWEEN LINES. THE DISPLAY IS COMPLETED BY ENDDSPLAY.
  2510. * NOTE THAT EOLDSPLAY INCLUDES LOGIC TO TURN PAGES.
  2511. #
  2512.  
  2513. CONTROL IFEQ SINGLE,1;
  2514.  
  2515. PROC BGNDSPLAY;
  2516. # TITLE BGNDSPLAY - INTIALIZE DEDICATED DISPLAY FORMAT. #
  2517.  
  2518. BEGIN # BGNDSPLAY #
  2519.  
  2520. #
  2521. ** BGNDSPLAY - INITIALIZE DEDICATED DISPLAY FORMAT.
  2522. *
  2523. * PROC BGNDSPLAY
  2524. *
  2525. * ENTRY SCREENMODE - ON FOR NON-TRIVIAL OPERATION.
  2526. *
  2527. * EXIT SCRNPT1 - INITIALIZED AS PAGE COUNTER.
  2528. * SCREEN CLEARED, CURSOR POSITIONED.
  2529. * TITLE1LIN, TITLE2LIN - CLEARED.
  2530. *
  2531. * CALLS PAINTNONE, VDTCLS, VDTPOS.
  2532. #
  2533.  
  2534. IF SCREENMODE THEN
  2535. BEGIN
  2536. IF SPLITFILE[2] NQ 0 THEN
  2537. BEGIN # IF IN SPLIT SCREEN MODE #
  2538. IF CURSPLIT EQ 1 THEN
  2539. BEGIN # IF FIRST SPLIT IS CURRENT #
  2540. CURSPLIT = 2; # CLEAR FOR OTHER SPLIT #
  2541. PAINTNONE;
  2542. CURSPLIT = 1; # RESET #
  2543. END
  2544. ELSE
  2545. BEGIN # CURRENT SPLIT IN THE SECOND #
  2546. CURSPLIT = 1; # CLEAR FOR OTHER SPLIT #
  2547. PAINTNONE;
  2548. CURSPLIT = 2; # RESET #
  2549. END
  2550. END
  2551. PAINTNONE;
  2552. VDTCLS;
  2553. TITLE1LINE[0]=NULLIN;
  2554. TITLE2LINE[0]=NULLIN;
  2555. SCRNPT1=TITLEROW[1];
  2556. VDTPOS(0,SCRNPT1);
  2557. END
  2558.  
  2559. END # BGNDSPLAY #
  2560.  
  2561.  
  2562. PROC ENDDSPLAY;
  2563. BEGIN
  2564. #
  2565. ** ENDDSPLAY - TERMINATE SPECIAL DISPLAY SEQUENCE.
  2566. *
  2567. * EXIT ROWPAINT[ALL] - TRUE.
  2568. *
  2569. * CALLS EOLDSPLAY, PAINTALL.
  2570. *
  2571. * USES SCRNPT1.
  2572. #
  2573. SCRNPT1=VTYMAX;
  2574. EOLDSPLAY;
  2575. PAINTALL;
  2576. END # OF ENDDSPLAY #
  2577.  
  2578.  
  2579. PROC EOLDSPLAY;
  2580. BEGIN
  2581. #
  2582. ** EOLDSPLAY - LINE BY LINE CONTROL FOR SPECIAL DISPLAYS.
  2583. *
  2584. * ENTRY SCREENMODE - TRUE FOR NON-TRIVIAL OPERATION.
  2585. * SCRNPT1 - AS INITIALIZED BY BGNDSPLAY OR INCREMENTED
  2586. * IN LAST CALL TO EOLDSPLAY.
  2587. *
  2588. * EXIT SCRNPT1 - INCREMENTED OR RE-INITIALIZED.
  2589. * CURSOR MOVED TO NEXT LINE.
  2590. *
  2591. * CALLS ASKUSER, BGNDSPLAY, VDTPOS, TTBRK.
  2592. *
  2593. * USES SCRNPT2.
  2594. #
  2595. IF SCREENMODE THEN
  2596. BEGIN
  2597. SCRNPT1=SCRNPT1+1;
  2598. SCRNPT2=USRNUMLIN;
  2599. IF SCRNPT2 EQ COMMANDROW THEN SCRNPT2=SCRNPT2-1;
  2600. IF SCRNPT1 GR SCRNPT2 THEN
  2601. BEGIN
  2602. ASKUSER("PRESS NEXT TO CONTINUE$",0);
  2603. BGNDSPLAY;
  2604. END
  2605. ELSE VDTPOS(0,SCRNPT1);
  2606. END
  2607. ELSE TTBRK;
  2608. END # OF EOLDSPLAY #
  2609.  
  2610. CONTROL FI;
  2611. PAGE # SCREEN SETUP/MANIPULATION #
  2612.  
  2613.  
  2614. PROC PAINTALL;
  2615. BEGIN
  2616. #
  2617. ** PAINTALL - SET PAINT BITS ON ALL LINES.
  2618. *
  2619. * EXIT ROWPAINT[ALL] - TRUE.
  2620. *
  2621. * CALLS PAINTREST.
  2622. #
  2623. PAINTREST(0);
  2624. END # OF PAINTALL #
  2625.  
  2626.  
  2627. PROC PAINTNONE;
  2628. BEGIN
  2629. #
  2630. ** PAINTNONE - CLEAR PAINT BITS FOR ONE SPLIT.
  2631. *
  2632. * ENTRY CURSPLIT - WHICH SPLIT TO SUPPRESS PAINT.
  2633. * TITLEROW[1-2], NUMROWS[1-2] - SETUP.
  2634. *
  2635. * EXIT ROWPAINT[ALL IN SPLIT] - FALSE.
  2636. * ROWORIG[ALL IN SPLIT] - NOMINAL.
  2637. #
  2638. FOR SCRNPT1=TITLEROW[CURSPLIT] STEP 1 UNTIL
  2639. TITLEROW[CURSPLIT]+NUMROWS[CURSPLIT] DO
  2640. BEGIN # SUPPRESS PAINTSCREEN OUTPUT #
  2641. ROWPAINT[SCRNPT1]=FALSE;
  2642. ROWORIG[SCRNPT1]=SCRNPT1;
  2643. END
  2644. END # OF PAINTNONE #
  2645.  
  2646.  
  2647. PROC PAINTREST(PARM);
  2648. # TITLE PAINTREST - SET PAINT BITS FOR REST OF SCREEN. #
  2649.  
  2650. BEGIN # PAINTREST #
  2651.  
  2652. #
  2653. ** PAINTREST - SET PAINT BITS FOR REST OF SCREEN.
  2654. *
  2655. * PROC PAINTREST(PARM)
  2656. *
  2657. * ENTRY PARM - FIRST LINE TO SET BIT FOR.
  2658. * VTYMAX - LAST LINE.
  2659. *
  2660. * EXIT ROWPAINT[THOSE] - TRUE.
  2661. #
  2662.  
  2663. ITEM PARM I; # FIRST LINE #
  2664. ITEM TMP1 I; # TEMPORARY STORAGE #
  2665.  
  2666. FOR TMP1=PARM STEP 1 UNTIL VTYMAX DO
  2667. BEGIN
  2668. ROWPAINT[TMP1]=TRUE;
  2669. IF ROWTYPE[TMP1] EQ ROWST"TITLE" THEN
  2670. BEGIN
  2671. IF ROWSPLIT[TMP1] EQ 1 THEN TITLE1LINE[0]=NULLIN;
  2672. ELSE TITLE2LINE[0]=NULLIN;
  2673. END
  2674. END
  2675.  
  2676. END # PAINTREST #
  2677.  
  2678.  
  2679. PROC PAINTSPLIT;
  2680. # TITLE PAINTSPLIT - SET PAINT BITS ALL LINES ONE SPLIT. #
  2681.  
  2682. BEGIN # PAINTSPLIT #
  2683.  
  2684. #
  2685. ** PAINTSPLIT - SET PAINT BITS ALL LINES ONE SPLIT.
  2686. *
  2687. * PROC PAINTSPLIT
  2688. *
  2689. * ENTRY CURSPLIT - WHICH SPLIT TO PAINT.
  2690. * TITLEROW[1-2], NUMROWS[1-2] - SETUP.
  2691. *
  2692. * EXIT ROWPAINT[ALL IN SPLIT] - TRUE.
  2693. *
  2694. * CALLS PAINTONESPLT.
  2695. #
  2696.  
  2697. PAINTONESPLT(CURSPLIT);
  2698.  
  2699. END # PAINTSPLIT #
  2700.  
  2701.  
  2702. PROC PAINTONESPLT(SPLIT);
  2703. # TITLE PAINTONESPLT - SET PAINT BITS ALL LINES ONE SPLIT. #
  2704.  
  2705. BEGIN # PAINTONESPLT #
  2706.  
  2707. #
  2708. ** PAINTONESPLT - SET PAINT BITS ALL LINES ONE SPLIT.
  2709. *
  2710. * PROC PAINTONESPLT(SPLIT)
  2711. *
  2712. * ENTRY SPLIT - WHICH SPLIT TO PAINT.
  2713. * TITLEROW[1-2], NUMROWS[1-2] - SETUP.
  2714. *
  2715. * EXIT ROWPAINT[ALL IN SPLIT] - TRUE.
  2716. #
  2717.  
  2718. ITEM SPLIT; # WHICH SPLIT TO PAINT #
  2719. ITEM TMP1; # TEMPORARY STORAGE #
  2720.  
  2721. FOR TMP1=TITLEROW[SPLIT] STEP 1 UNTIL
  2722. TITLEROW[SPLIT]+NUMROWS[SPLIT] DO ROWPAINT[TMP1]=TRUE;
  2723.  
  2724. END # PAINTONESPLT #
  2725.  
  2726.  
  2727. PROC SETUPSCREEN(I,J,K);
  2728. BEGIN
  2729. #
  2730. ** SETUPSCREEN - INITIALIZE ALL SCREEN FORMAT CONTROLS.
  2731. *
  2732. * ENTRY I - FILE BRACKET NUMBER FOR SPLIT 1.
  2733. * J - FILE BRACKET NUMBER FOR SPLIT 2.
  2734. * K - NUMBER OF DATA LINES IN BOTTOM SPLIT.
  2735. * TABVTHOMEU[0] - CONTROLS SELECTION OF COMMANDROW.
  2736. * FKEYNUMROW - WHETHER TO INCLUDE FUNCTION KEY DISPLAY.
  2737. *
  2738. * EXIT COMMANDROW, FKEYROW - SETUP.
  2739. * TITLEROW[1-2], NUMROWS[1-2] - SETUP.
  2740. * TOPS(1-2), BOTS(1-2) - SETUP.
  2741. * ALL ROW CONTROLS SETUP.
  2742. *
  2743. * CALLS SETTOPBOTS, SETROWTYPE.
  2744. *
  2745. * USES SCRNPT1, SCRNPT2.
  2746. #
  2747. ITEM I,J,K;
  2748. ITEM NKEYS, NTITLES;
  2749.  
  2750.  
  2751. PROC SETROWSPLIT;
  2752. # TITLE SETROWSPLIT - INITIALIZE ROWSPLIT VECTOR. #
  2753.  
  2754. BEGIN # SETROWSPLIT #
  2755.  
  2756. #
  2757. ** SETROWSPLIT - INITIALIZE ROWSPLIT VECTOR.
  2758. *
  2759. * PROC SETROWSPLIT
  2760. *
  2761. * ENTRY CURSPLIT - WHICH SPLIT.
  2762. * TITLEROW[1-2], NUMROWS[1-2] - SETUP.
  2763. *
  2764. * EXIT ROWTYPE[ALL IN SPLIT] - INITIALIZED.
  2765. * ROWSPLIT[ALL IN SPLIT] - INITIALIZED.
  2766. *
  2767. * CALLS PAINTSPLIT.
  2768. *
  2769. * USES SCRNPT1, SCRNPT5.
  2770. #
  2771.  
  2772. IF ROWTYPE[TITLEROW[CURSPLIT]] NQ ROWST"TITLE"
  2773. OR ROWSPLIT[TITLEROW[CURSPLIT]] NQ CURSPLIT THEN
  2774. BEGIN
  2775. PAINTSPLIT;
  2776. IF CURSPLIT EQ 1 THEN TITLE1LINE[0]=NULLIN;
  2777. ELSE TITLE2LINE[0]=NULLIN;
  2778. END
  2779. ROWTYPE[TITLEROW[CURSPLIT]]=ROWST"TITLE";
  2780. ROWSPLIT[TITLEROW[CURSPLIT]]=CURSPLIT;
  2781. FOR SCRNPT1=1 STEP 1 UNTIL NUMROWS[CURSPLIT] DO
  2782. BEGIN
  2783. SCRNPT5=SCRNPT1+TITLEROW[CURSPLIT];
  2784. IF ROWTYPE[SCRNPT5] NQ ROWST"TEXT"
  2785. OR ROWSPLIT[SCRNPT5] NQ CURSPLIT THEN ROWPAINT[SCRNPT5]=TRUE;
  2786. ROWTYPE[SCRNPT5]=ROWST"TEXT";
  2787. ROWSPLIT[SCRNPT5]=CURSPLIT;
  2788. END
  2789.  
  2790. END # SETROWSPLIT #
  2791.  
  2792.  
  2793. PROC SETROWTYPE;
  2794. BEGIN
  2795. #
  2796. ** SETROWTYPE - CLASSIFY LINES BY TYPE OF DISPLAY.
  2797. *
  2798. * ENTRY COMMANDROW, RESPONSEROW, TITLEROW[1-2],
  2799. * FKEYROW, SPLITFILE[1-2] - INITIALIZED.
  2800. * VTYMAX - NUMBER OF LINES ON SCREEN.
  2801. *
  2802. * EXIT ROWTYPE[ALL] - INITIALIZED.
  2803. * ROWSPLIT[ALL] - INITIALIZED.
  2804. * CURSPLIT - INITIALIZED.
  2805. *
  2806. * CALLS SETROWSPLIT.
  2807. *
  2808. * USES SCRNPT1, SCRNPT2, SCRNPT3.
  2809. #
  2810. ROWTYPE[COMMANDROW]=ROWST"COMMAND";
  2811. ROWSPLIT[COMMANDROW]=1;
  2812. ROWTYPE[RESPONSEROW] = ROWST"RESPONSE";
  2813.  
  2814. CURSPLIT=1;
  2815. SETROWSPLIT;
  2816. IF SPLITFILE[2] NQ 0 THEN
  2817. BEGIN
  2818. CURSPLIT=2;
  2819. SETROWSPLIT;
  2820. END
  2821.  
  2822. IF FKEYNUMROW EQ 0 THEN SCRNPT1=-1;
  2823. ELSE SCRNPT1=FKEYNUMROW*(2+SHIFTFKEY)-2;
  2824. FOR SCRNPT2=0 STEP 1 UNTIL SCRNPT1 DO
  2825. BEGIN
  2826. IF ROWTYPE[FKEYROW+SCRNPT2] NQ ROWST"LABEL" THEN
  2827. BEGIN
  2828. ROWPAINT[FKEYROW+SCRNPT2]=TRUE;
  2829. ROWTYPE[FKEYROW+SCRNPT2]=ROWST"LABEL";
  2830. END
  2831. END
  2832. SCRNPT1=FKEYROW+SCRNPT1+1;
  2833. SCRNPT3=VTYMAX;
  2834. IF COMMANDROW EQ VTYMAX THEN SCRNPT3=VTYMAX-1;
  2835. FOR SCRNPT2=SCRNPT1 STEP 1 UNTIL SCRNPT3 DO
  2836. BEGIN
  2837. # BLANK OUT BOTTOM OF SCREEN IF USER REQUESTED SHORT SCREEN #
  2838. IF ROWTYPE[SCRNPT2] NQ ROWST"EMPTY" THEN ROWPAINT[SCRNPT2]=TRUE;
  2839. ROWTYPE[SCRNPT2]=ROWST"EMPTY";
  2840. END
  2841.  
  2842. END # OF SETROWTYPE #
  2843.  
  2844.  
  2845. # ACTUAL SETUPSCREEN MAIN CODE STARTS HERE #
  2846.  
  2847. IF NOT SCREENMODE THEN RETURN;
  2848.  
  2849. IF TABVTHOMEU[0] THEN
  2850. BEGIN
  2851. COMMANDROW=0;
  2852. RESPONSEROW=1;
  2853. TITLEROW[1]=2;
  2854. END
  2855. ELSE
  2856. BEGIN
  2857. COMMANDROW=VTYMAX;
  2858. RESPONSEROW = VTYMAX-1;
  2859. TITLEROW[1]=0;
  2860. END
  2861.  
  2862. SPLITFILE[1]=I;
  2863. SPLITFILE[2]=J;
  2864.  
  2865. SFKEYDEFS = 0;
  2866. SCRNPT1 = 1;
  2867. FOR SCRNPT2 = 1 STEP 1 UNTIL POSFKEYS DO
  2868. BEGIN
  2869. IF (FKEYNAME[SCRNPT2] NQ " ") OR
  2870. (FKEYNAME[-SCRNPT2] NQ " ") THEN
  2871. BEGIN # IF FUNCTION KEY DEFINED #
  2872. FKEYNUMS[SCRNPT1] = SCRNPT2;
  2873. SCRNPT1 = SCRNPT1 + 1;
  2874. IF FKEYNAME[-SCRNPT2] NQ " " THEN SFKEYDEFS = 1;
  2875. END
  2876. END
  2877. FOR SCRNPT1 = SCRNPT1 STEP 1 UNTIL POSFKEYS DO
  2878. FKEYNUMS[SCRNPT1] = 0;
  2879. SHIFTFKEY = SFKEYDEFS LAN SFKEYSHOW;
  2880. NKEYS=MAX(0,FKEYNUMROW*(2+SHIFTFKEY)-1);
  2881. FKEYROW = USRNUMLIN + TITLEROW[1] - (NKEYS + 1);
  2882.  
  2883. NUMROWS[1]=0;
  2884. IF K LS 0 THEN NUMROWS[2]=(USRNUMLIN-2-NKEYS)/2;
  2885. ELSE NUMROWS[2]=MIN(K,(USRNUMLIN-2-NKEYS));
  2886.  
  2887. IF J EQ 0 THEN NTITLES=1;
  2888. ELSE NTITLES=2;
  2889.  
  2890. IF I NQ 0 THEN
  2891. BEGIN
  2892. NUMROWS[1]=USRNUMLIN-NKEYS-NTITLES-NUMROWS[2]-1;
  2893. SETTOPBOTS(1);
  2894. END
  2895. IF J NQ 0 THEN
  2896. BEGIN
  2897. TITLEROW[2]=USRNUMLIN-NKEYS-NUMROWS[2]-2+TITLEROW[1];
  2898. SETTOPBOTS(2);
  2899. END
  2900. ELSE TITLEROW[2]=TITLEROW[1]+NUMROWS[1];
  2901. SETROWTYPE;
  2902. IF TABLOCKMDE[0] OR TABATTRCHR[0] THEN
  2903. BEGIN # IF ATTRIBUTE TAKES A POSITION #
  2904. IF TABLOCKMDE[0] THEN ATTCOUNT = 1;
  2905. FKEYSPC1 = "$";
  2906. FKEYSPC2 = " $";
  2907. END
  2908. ELSE
  2909. BEGIN # CHARACTER MODE TERMINAL #
  2910. ATTCOUNT = 0; # NO ATTRIBUTE BYTE #
  2911. FKEYSPC1 = " $";
  2912. FKEYSPC2 = " $";
  2913. END
  2914. END # OF SETUPSCREEN #
  2915.  
  2916. CONTROL IFEQ SINGLE,1;
  2917. PROC CLEARSCREEN;
  2918. # TITLE CLEARSCREEN - GET BACK TO LINE MODE. #
  2919.  
  2920. BEGIN # CLEARSCREEN #
  2921.  
  2922. #
  2923. ** CLEARSCREEN - GET BACK TO LINE MODE.
  2924. *
  2925. * EXIT SCREEN CLEARED.
  2926. * VIRTERM SHUT DOWN VIA VDTSTM ROUTINE.
  2927. * ALL PAINT BITS TRUE.
  2928. *
  2929. * CALLS PAINTALL, VDTCLS, VDTSTM.
  2930. *
  2931. * USES SCRNPT1.
  2932. #
  2933.  
  2934. IF SCREENMODE THEN
  2935. BEGIN
  2936. VDTCLS;
  2937. PAINTALL;
  2938. VDTSTM(0,SCRNPT1); # SET LINE MODE #
  2939. ATTCOUNT = 0; # CLEAR ATTRIBUTE BYTE COUNT #
  2940. END
  2941.  
  2942. END # CLEARSCREEN #
  2943. CONTROL FI;
  2944. PAGE # EDITOR/WORKIO/SCREEN INTERFACE #
  2945.  
  2946.  
  2947. PROC SETTOPBOTS(SPLIT);
  2948. # TITLE SETTOPBOTS - FORCE TOPS AND BOTS TO BRACKET CURRENT. #
  2949.  
  2950. BEGIN # SETTOPBOTS #
  2951.  
  2952. #
  2953. ** SETTOPBOTS - FORCE TOPS AND BOTS TO BRACKET CURRENT.
  2954. *
  2955. * SETTOPBOTS ASSURES THAT TOPS AND BOTS ARE WITHIN LEGAL
  2956. * FILE BOUNDARIES AND THAT THEY BRACKET THE CURRENT LINE.
  2957. * IF THESE CONDITIONS ARE ALREADY TRUE, NOTHING IS CHANGED.
  2958. * ELSE WE BUILD NEW SPLIT STARTING AT CURRENT LINE.
  2959. *
  2960. * PROC SETTOPBOTS(SPLIT)
  2961. *
  2962. * ENTRY SPLIT - WHICH SPLIT.
  2963. * SPLITFILE[SPLIT] - SETUP.
  2964. * CURF(SPLITFILE[SPLIT]) - CURRENT LINE.
  2965. * TOPS(SPLIT), BOTS(SPLIT) - POSSIBLY ALREADY VALID.
  2966. *
  2967. * EXIT TOPS(SPLIT), BOTS(SPLIT) - GUARANTEED VALID.
  2968. * ROWPAINT[ALL THIS SPLIT] - POSSIBLY TRUE.
  2969. *
  2970. * CALLS SETTOPS, SETBOTS, PAINTONESPLT.
  2971. #
  2972.  
  2973. ITEM SPLIT I; # WHICH SPLIT #
  2974. ITEM L I; # LINE #
  2975.  
  2976. SETTOPS(SPLIT);
  2977. SETBOTS(SPLIT);
  2978. L=CURF(SPLITFILE[SPLIT]);
  2979. L=MAX(L,TOPF(SPLITFILE[SPLIT])+1);
  2980. L=MIN(L,BOTF(SPLITFILE[SPLIT])-1);
  2981. IF L LQ TOPS(SPLIT) OR L GQ BOTS(SPLIT) THEN
  2982. BEGIN
  2983. TOPS(SPLIT)=L-1;
  2984. SETTOPS(SPLIT);
  2985. SETBOTS(SPLIT);
  2986. IF BOTS(SPLIT) GR TOPS(SPLIT)+1 THEN PAINTONESPLT(SPLIT);
  2987. END
  2988.  
  2989. END # SETTOPBOTS #
  2990.  
  2991.  
  2992. PROC SETTOPS(SPLIT);
  2993. BEGIN
  2994. #
  2995. ** SETTOPS - ASSURE TOPS() IS IN FILE BOUNDS.
  2996. *
  2997. * ENTRY SPLIT - WHICH SPLIT.
  2998. * SPLITFILE[SPLIT] - WHICH FILE.
  2999. * TOPF(FILE), BOTF(FILE) - FILE BOUNDARIES.
  3000. *
  3001. * EXIT TOPS(SPLIT) - GUARANTEED IN BOUNDS.
  3002. #
  3003. ITEM SPLIT;
  3004. TOPS(SPLIT)=MIN(TOPS(SPLIT),BOTF(SPLITFILE[SPLIT])-2);
  3005. TOPS(SPLIT)=MAX(TOPS(SPLIT),TOPF(SPLITFILE[SPLIT]));
  3006. END # OF SETTOPS #
  3007.  
  3008.  
  3009. PROC SETBOTS(SPLIT);
  3010. BEGIN
  3011. #
  3012. ** SETBOTS - SET BOTS() BY TOPS() AND FILE BOUNDS.
  3013. *
  3014. * ENTRY SPLIT - WHICH SPLIT.
  3015. * SPLITFILE[SPLIT] - WHICH FILE BRACKET.
  3016. * TOPS(SPLIT), BOTF(FILE) - SETUP.
  3017. *
  3018. * EXIT BOTS(SPLIT) - DEFINED.
  3019. #
  3020. ITEM SPLIT;
  3021. BOTS(SPLIT)=MIN(TOPS(SPLIT)+NUMROWS[SPLIT]+1,BOTF(SPLITFILE[SPLIT]));
  3022. END # OF SETBOTS #
  3023.  
  3024.  
  3025. PROC REPX;
  3026. IOBEGIN(REPX)
  3027. #
  3028. ** REPX - INTERFACE FOR LINE REPLACEMENT.
  3029. *
  3030. * REPX IS CALLED BY ANY ROUTINE IN THE EDITOR WHICH IS
  3031. * REPLACING A TEXT LINE IN THE WORKFILE. NOTE THAT WE
  3032. * DEFINE TEXT LINES AS LINES WITHIN FILE BRACKETS. THIS
  3033. * DOES NOT INCLUDE LINES IN THE AUDIT TRAIL OR IN THE
  3034. * FILE DIRECTORY.
  3035. *
  3036. * REPX ASSURES THAT ANY SCREEN DISPLAY OF THE LINE IS
  3037. * FLAGGED FOR REPAINT WHEN NEEDED. REPAINT IS NOT NEEDED
  3038. * FOR CHANGES MADE BY THE DOSCREEN ROUTINE TO MIMIC TERMINAL
  3039. * HARDWARE CAPABILITIES. THIS IS DENOTED BY THE HARDFN FLAG.
  3040. *
  3041. * LOGIC FOR THIS ROUTINE MUST CHECK SCREEN BOUNDARIES SINCE
  3042. * CHANGES CAN BE MADE OFF-SCREEN. ALSO MUST CHECK FOR OVER-
  3043. * LAPPED SPLITS OF SAME FILE - EVEN IF CHANGE CAME AS A
  3044. * HARD FUNCTION, THE OVERLAPPED VERSON STILL NEEDS PAINTING.
  3045. *
  3046. * ENTRY LIN - THE LINE IMAGE AS CHANGED.
  3047. * CURRENT, CURSPLIT, CURFILE - WHERE WE ARE.
  3048. * HARDFN - TRUE IF MIMIC-ING WHAT HARDWARE ALREADY DID.
  3049. * TOPS(BOTH), BOTS(BOTH) - BRACKET THE LINES ON DISPLAY.
  3050. * SCREENMODE - TRUE FOR NON-TRIVIAL OPERATION.
  3051. *
  3052. * EXIT ROWPAINT[RIGHT ROWS] - SET TRUE IF NEEDED.
  3053. * WORKFILE ACCESS METHOD CALLED TO MANAGE UPDATE.
  3054. *
  3055. * CALLS REPS (INTERNAL), REPZ.
  3056. #
  3057.  
  3058. PROC REPS(SPLIT);
  3059. BEGIN
  3060. #
  3061. ** REPS - INTERNAL LOGIC FOR REPX.
  3062. *
  3063. * NOTE SEE HEADER FOR REPX.
  3064. #
  3065. ITEM SPLIT;
  3066. IF CURRENT GR TOPS(SPLIT) AND CURRENT LS BOTS(SPLIT)
  3067. AND (SPLIT NQ CURSPLIT OR NOT HARDFN)
  3068. THEN ROWPAINT[LTOY(CURRENT,SPLIT)]=TRUE;
  3069. END # OF REPS #
  3070.  
  3071. # ACTUAL REPX CODE STARTS HERE #
  3072. REPZ;
  3073. IF SCREENMODE THEN
  3074. BEGIN
  3075. REPS(1);
  3076. REPS(2);
  3077. END
  3078. IOEND # OF REPX #
  3079.  
  3080.  
  3081. PROC INSX;
  3082. IOBEGIN(INSX)
  3083. #
  3084. ** INSX - INTERFACE FOR LINE INSERTION.
  3085. *
  3086. * INSX IS CALLED BY ANY ROUTINE IN THE EDITOR WHICH IS
  3087. * INSERTING A TEXT LINE IN THE WORKFILE. NOTE THAT WE
  3088. * DEFINE TEXT LINES AS LINES WITHIN FILE BRACKETS. THIS
  3089. * DOES NOT INCLUDE LINES IN THE AUDIT TRAIL OR IN THE
  3090. * FILE DIRECTORY.
  3091. *
  3092. * INSX ASSURES THAT ANY SCREEN DISPLAY OF THE LINE IS
  3093. * FLAGGED FOR REPAINT WHEN NEEDED. REPAINT IS NOT NEEDED
  3094. * FOR CHANGES MADE BY THE DOSCREEN ROUTINE TO MIMIC TERMINAL
  3095. * HARDWARE CAPABILITIES. THIS IS DENOTED BY THE HARDFN FLAG.
  3096. *
  3097. * LOGIC FOR THIS ROUTINE MUST CHECK SCREEN BOUNDARIES SINCE
  3098. * CHANGES CAN BE MADE OFF-SCREEN. ALSO MUST CHECK FOR OVER-
  3099. * LAPPED SPLITS OF SAME FILE - EVEN IF CHANGE CAME AS A
  3100. * HARD FUNCTION, THE OVERLAPPED VERSON STILL NEEDS PAINTING.
  3101. *
  3102. * ENTRY LIN - THE LINE IMAGE TO BE INSERTED.
  3103. * CURRENT, CURSPLIT, CURFILE - WHERE WE ARE.
  3104. * HARDFN - TRUE IF MIMIC-ING WHAT HARDWARE ALREADY DID.
  3105. * TOPS(BOTH), BOTS(BOTH) - BRACKET THE LINES ON DISPLAY.
  3106. * SCREENMODE - TRUE FOR NON-TRIVIAL OPERATION.
  3107. * TABVTPROTM[0] - TERMINAL CAPABILITY TO PROTECT FIELDS.
  3108. *
  3109. * EXIT ROWPAINT[RIGHT ROWS] - SET TRUE IF NEEDED.
  3110. * ROWPAINT[LOWER], ROWBITS[LOWER] - PROPOGATED AS NEEDED.
  3111. * WORKFILE ACCESS METHOD CALLED TO MANAGE UPDATE.
  3112. *
  3113. * CALLS INSS (INTERNAL), INSZ.
  3114. #
  3115.  
  3116. PROC INSS(SPLIT);
  3117. BEGIN
  3118. #
  3119. ** INSS - INTERNAL LOGIC FOR INSX.
  3120. *
  3121. * NOTE SEE HEADER FOR INSX.
  3122. #
  3123. ITEM SPLIT, I, THISROW, LASTROW;
  3124. IF SPLITFILE[SPLIT] NQ 0 THEN
  3125. BEGIN
  3126. IF CURRENT GR TOPF(SPLITFILE[SPLIT]) AND
  3127. CURRENT LS BOTF(SPLITFILE[SPLIT]) THEN
  3128. BEGIN
  3129. SETBOTS(SPLIT);
  3130. IF CURRENT GR TOPS(SPLIT) AND CURRENT LS BOTS(SPLIT) THEN
  3131. BEGIN
  3132. THISROW=LTOY(CURRENT,SPLIT);
  3133. LASTROW=TITLEROW[SPLIT]+NUMROWS[SPLIT];
  3134. FOR I=LASTROW STEP -1 UNTIL THISROW+1 DO
  3135. BEGIN
  3136. ROWPAINT[I]=ROWPAINT[I-1];
  3137. ROWBITS[I]=ROWBITS[I-1];
  3138. END
  3139. IF HARDFN AND SPLIT EQ CURSPLIT THEN
  3140. BEGIN
  3141. IF NOT TABVTPROTM[0] THEN PAINTREST(LASTROW+1);
  3142. END
  3143. ELSE
  3144. BEGIN
  3145. FOR I=LASTROW STEP -1 UNTIL THISROW+1
  3146. DO ROWORIG[I]=ROWORIG[I-1];
  3147. ROWORIG[THISROW]=0;
  3148. END
  3149. END
  3150. END
  3151. END
  3152. END # OF INSS #
  3153.  
  3154. # ACTUAL INSX CODE STARTS HERE #
  3155. INSZ;
  3156. IF SCREENMODE THEN
  3157. BEGIN
  3158. INSS(1);
  3159. INSS(2);
  3160. END
  3161. IOEND # OF INSX #
  3162.  
  3163.  
  3164. PROC DELX;
  3165. IOBEGIN(DELX)
  3166. #
  3167. ** DELX - INTERFACE FOR LINE DELETION.
  3168. *
  3169. * DELX IS CALLED BY ANY ROUTINE IN THE EDITOR WHICH IS
  3170. * DELETEING A TEXT LINE IN THE WORKFILE. NOTE THAT WE
  3171. * DEFINE TEXT LINES AS LINES WITHIN FILE BRACKETS. THIS
  3172. * DOES NOT INCLUDE LINES IN THE AUDIT TRAIL OR IN THE
  3173. * FILE DIRECTORY.
  3174. *
  3175. * DELX ASSURES THAT ANY SCREEN DISPLAY OF THE LINE IS
  3176. * FLAGGED FOR REPAINT WHEN NEEDED. REPAINT IS NOT NEEDED
  3177. * FOR CHANGES MADE BY THE DOSCREEN ROUTINE TO MIMIC TERMINAL
  3178. * HARDWARE CAPABILITIES. THIS IS DENOTED BY THE HARDFN FLAG.
  3179. *
  3180. * LOGIC FOR THIS ROUTINE MUST CHECK SCREEN BOUNDARIES SINCE
  3181. * CHANGES CAN BE MADE OFF-SCREEN. ALSO MUST CHECK FOR OVER-
  3182. * LAPPED SPLITS OF SAME FILE - EVEN IF CHANGE CAME AS A
  3183. * HARD FUNCTION, THE OVERLAPPED VERSON STILL NEEDS PAINTING.
  3184. *
  3185. * ENTRY LIN - THE LINE IMAGE TO BE DELETED.
  3186. * CURRENT, CURSPLIT, CURFILE - WHERE WE ARE.
  3187. * HARDFN - TRUE IF MIMIC-ING WHAT HARDWARE ALREADY DID.
  3188. * TABVTPROTM[0] - TERMINAL CAPABILITY TO PROTECT FIELDS.
  3189. * TOPS(BOTH), BOTS(BOTH) - BRACKET THE LINES ON DISPLAY.
  3190. * SCREENMODE - TRUE FOR NON-TRIVIAL OPERATION.
  3191. *
  3192. * EXIT ROWPAINT[RIGHT ROWS] - SET TRUE IF NEEDED.
  3193. * ROWPAINT[LOWER], ROWBITS[LOWER] - POSSIBLY PROPOGATED.
  3194. * LIN - UNAFFECTED BY DELX CODE. MAY BE AFFECTED BY
  3195. * PASS-ON CALL TO DELZ.
  3196. * WORKFILE ACCESS METHOD CALLED TO MANAGE UPDATE.
  3197. *
  3198. * CALLS DELS (INTERNAL), DELZ.
  3199. #
  3200. ITEM SPLIT; # TEMPORARY SPLIT REFERENCE #
  3201.  
  3202. PROC DELS(SPLIT);
  3203. BEGIN
  3204. #
  3205. ** DELS - INTERNAL LOGIC FOR DELX.
  3206. *
  3207. * NOTE SEE HEADER FOR DELX.
  3208. #
  3209. ITEM SPLIT,I,THISROW,LASTROW;
  3210. IF SPLITFILE[SPLIT] NQ 0 THEN
  3211. BEGIN # IF A FILE IN THIS SPLIT #
  3212. IF TEMP GR 0 THEN
  3213. BEGIN # IF DELETED LINE WAS ON SCREEN #
  3214. THISROW=CURRENT-DELETCTL;
  3215. THISROW=LTOY(THISROW,SPLIT);
  3216. LASTROW=TITLEROW[SPLIT]+NUMROWS[SPLIT];
  3217. FOR I=THISROW+2 STEP 1 UNTIL LASTROW DO
  3218. BEGIN # REPAINT LINES AFTER DELETION #
  3219. ROWPAINT[I-1]=ROWPAINT[I];
  3220. ROWBITS[I-1]=ROWBITS[I];
  3221. END
  3222. ROWPAINT[LASTROW]=TRUE;
  3223. IF HARDFN AND SPLIT EQ CURSPLIT THEN
  3224. BEGIN
  3225. IF NOT TABVTPROTM[0] THEN PAINTREST(LASTROW);
  3226. END
  3227. ELSE
  3228. BEGIN
  3229. ROWORIG[THISROW]=0;
  3230. FOR I=THISROW+2 STEP 1 UNTIL LASTROW
  3231. DO ROWORIG[I-1]=ROWORIG[I];
  3232. END
  3233. END
  3234. POPTEMP;
  3235. END
  3236. END # OF DELS #
  3237.  
  3238. # ACTUAL DELX CODE STARTS HERE #
  3239.  
  3240. IF NUMMARKS GR 0 THEN
  3241. BEGIN # IF MARK IS ACTIVE #
  3242. IF CURRENT EQ REGLINE[MARKREG] THEN
  3243. BEGIN # IF FIRST MARKED LINE DELETED #
  3244. IF REGLINE[MARKREG+1] GR CURRENT THEN
  3245. BEGIN # IF MORE THAN ONE MARKED LINE #
  3246. REGLINE[MARKREG] = CURRENT + 1;
  3247. MRKCHAR[0] = - 1;
  3248. END
  3249. ELSE
  3250. BEGIN # ONLY ONE MARKED LINE #
  3251. KILLMARKS = TRUE;
  3252. END
  3253. END
  3254. ELSE
  3255. BEGIN # NOT FIRST MARKED LINE DELETED #
  3256. IF CURRENT EQ REGLINE[MARKREG+1] THEN
  3257. BEGIN # IF LAST MARKED LINE DELETED #
  3258. IF REGLINE[MARKREG] LS CURRENT THEN
  3259. BEGIN # IF MORE THAN ONE MARKED LINE #
  3260. REGLINE[MARKREG+1] = CURRENT - 1;
  3261. MRKCHAR[1] = - 1;
  3262. END
  3263. ELSE
  3264. BEGIN # ONLY ONE MARKED LINE #
  3265. KILLMARKS = TRUE;
  3266. END
  3267. END
  3268. END
  3269. END
  3270. IF SCREENMODE THEN
  3271. BEGIN
  3272. FOR SPLIT=2 STEP -1 UNTIL 1 DO
  3273. BEGIN
  3274. IF SPLITFILE[SPLIT] NQ 0 THEN
  3275. BEGIN # IF A FILE IN THIS SPLIT #
  3276. PUSHTEMP;
  3277. TEMP = 0;
  3278. IF CURRENT GQ TOPF(SPLITFILE[SPLIT]) AND
  3279. CURRENT LQ BOTF(SPLITFILE[SPLIT]) THEN
  3280. BEGIN # IF DELETING LINE IN THIS FILE #
  3281. IF CURRENT GR TOPS(SPLIT) AND CURRENT LQ BOTS(SPLIT) THEN
  3282. TEMP = 1;
  3283. END
  3284. END
  3285. END
  3286. DELZ;
  3287. DELS(1);
  3288. DELS(2);
  3289. END
  3290. ELSE DELZ;
  3291. IOEND # OF DELX #
  3292.  
  3293.  
  3294. END TERM
cdc/nos2.source/opl871/fsescrn.txt ยท Last modified: 2023/08/05 17:24 by Site Administrator