Benutzer-Werkzeuge

Webseiten-Werkzeuge


papierkorb:ledit.blk

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

papierkorb:ledit.blk [2025-08-16 17:50] – ↷ Seite von projects:ledit.blk nach papierkorb:ledit.blk verschoben mkapapierkorb:ledit.blk [Unbekanntes Datum] (aktuell) – gelöscht - Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1
Zeile 1: Zeile 1:
-===DOSEDIT style forth input line editor=== 
  
-<code> 
-Screen 0 not modified      
-                                                                  
- 1 \ Last change:   Screen  029                   14:33JWB03/03/87  
-                                                                  
-                                                                  
-                                                                  
-                                                                  
-                                                                  
-                                                                  
-                                                                  
-                                                                  
-10                                                                  
-11                                                                  
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 1 not modified      
- 0 \ LEDIT LOAD SCREEN                            11:29JWB11/23/85  
-                                                                  
- 2 ONLY FORTH DEFINITIONS ALSO                                      
-                                                                  
-     : LTASK ;                                                    
-                                                                  
-      35  THRU                                                  
-                                                                  
-                                                                  
-                                                                  
-10                                                                  
-11                                                                  
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 2 not modified      
- 0 \ Line editor variables                        09:49JWB02/07/86  
-                                                                  
- 2 ONLY EDITOR ALSO FORTH DEFINITIONS                               
-                                                                  
- 4 VARIABLE %MOD   \ Type-over/Insert flag.   True=Insert.          
- 5 VARIABLE %BUF   \ Address of line buffer.                        
- 6 VARIABLE %MLEN  \ Length of line buffer.                         
- 7 VARIABLE %OFF   \ Offset to start of line.                       
- 8 VARIABLE %ROW   \ Current row or vertical position on screen.    
- 9 VARIABLE %POS   \ Current position in the line.                  
-10 VARIABLE %DONE  \ Finished flag.  If true then quit.             
-11 VARIABLE LKEY   \ Last key code pressed.                         
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 3 not modified      
- 0 \ #R  POS@                                     09:49JWB02/07/86  
-                                                                  
- 2 : #R    ( --  n )  \ Leave n, characters to right of cursor.     
-                                                                  
-         %MLEN @    \ Fetch length of line buffer.                
-         %POS @     \ Fetch current cursor position.              
-         - ;        \ Subtract leaving number of characters to    
-                    \ right of cursor.                            
-                                                                  
- 9 : POS@  ( --  adr ) \ Leave address of current cursor position.  
-10                                                                  
-11         %BUF @     \ Fetch address of line buffer.               
-12         %POS @     \ Fetch current cursor position.              
-13         + ;        \ Add leaving current address of cursor.      
-14                                                                  
-15                                                                  
- 
- 
-Screen 4 not modified      
- 0 \ CUR                                          09:49JWB02/07/86  
-                                                                  
- 2 : CUR   ( row col   -- ) \ Position cursor at  (col,row)         
-                                                                  
-         80 MOD          \ Calculate column position.             
-         SWAP            \ Bring row to top of stack.             
-         25 MOD          \ Calculate row position.                
-         GOTOXY ;        \ Word that positions cursor.            
-                                                                  
-                                                                  
-10                                                                  
-11                                                                  
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 5 not modified      
- 0 \ .POS                                         09:49JWB02/07/86  
-                                                                  
- 2 : .POS  ( --   -- ) \ Move cursor to its current position.       
-                                                                  
-         %POS @      \ Fetch current position in line.            
-         %MLEN @     \ Fetch length of line buffer.               
-         MOD         \ Divide leaving cursor position.            
-         %OFF @ +    \ Fetch offset to start of line and add      
-                     \ to cursor position.                        
-         %ROW @      \ Fetch current row.                         
-10         SWAP        \ Put (col,row) in proper order for CUR      
-11         CUR ;       \ Position cursor at (col,row).              
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 6 not modified      
- 0 \ !POS  +POS                                   09:49JWB02/07/86  
-                                                                  
- 2 : !POS  ( n    -- ) \ Set current position to n.                 
-                                                                  
-         %MLEN @ MOD   \ Take top stack value and divide by       
-                       \ length of line buffer, leaving remainder 
-         %POS ! ;      \ which is stored at current position in   
-                       \ line.                                    
-                                                                  
- 9 : +POS  ( n    -- ) \ Increment current position by n.           
-10                                                                  
-11         %POS @ +      \ Fetch current position in line and add   
-12         !POS ;        \ value "n" to it. Store back at current   
-13                       \ position in line.                        
-14                                                                  
-15                                                                  
- 
- 
-Screen 7 not modified      
- 0 \ +.POS  HOM                                   09:49JWB02/07/86  
-                                                                  
- 2 : +.POS ( n    -- ) \ Increment by n and display at new location 
-                                                                  
-         +POS        \ Increments current position by "n"         
-         .POS ;      \ Moves cursor to its current position.      
-                                                                  
-                                                                  
- 8 : HOM   ( --   -- )     \ To begining of line, type-over mode.   
-                                                                  
-10         %POS OFF    \ Set current position in line to zero.      
-11         .POS        \ Move cursor to current position in line.   
-12         %MOD OFF ;  \ Set insert mode to false.                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 8 not modified      
- 0 \ !CHAR  ECHO                                  09:49JWB02/07/86  
-                                                                  
- 2 : !CHAR ( char   -- )   \ Store character at current position.   
-                                                                  
-         POS@ C!     \ Fetch address of current cursor position   
-                     \ and store character there.                 
-         1 +.POS ;   \ Increment cursor position by one and       
-                     \ display at new location.                   
-                                                                  
- 9 : ECHO  ( char   -- )   \ Echo character and store character.    
-10                                                                  
-11         DUP  (CONSOLE)  \ Output character to console device.    
-12         !CHAR ;         \ Store character at current position.   
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 9 not modified      
- 0 \ CTYPE                                        09:49JWB02/07/86  
-                                                                  
- 2 : CTYPE  ( adr cnt   -- ) \ Send string to console only.         
-                                                                  
-         0 ?DO           \ Set up loop with character count.      
-             COUNT       \ Fetch char from adr and increment      
-                         \ adr by one.                            
-             (CONSOLE)   \ Output char to current console device. 
-           LOOP          \ Loop back.                             
-           DROP ;        \ Clean up stack.                        
-10                                                                  
-11                                                                  
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 10 not modified      
- 0 \ .LIN                                         09:49JWB02/07/86  
-                                                                  
- 2 : .LIN  ( --   -- )     \ Update entire line.                    
-         %POS @     \ Fetch current position in line.             
-         HOM        \ Move cursor to beginning of line.           
-         %BUF @     \ Fetch address of line buffer.               
-         %MLEN @    \ Fetch length of line buffer.                
-         CTYPE      \ Output entire line buffer to console.       
-         %POS !     \ Restore previous cursor position in line    
-         .POS   ;   \ and move cursor to the current position.    
-10                                                                  
-11                                                                  
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 11 not modified      
- 0 \ RUB                                          09:49JWB02/07/86  
-                                                                  
- 2 : RUB   ( --   -- )     \ Rub out character behind cursor.       
-                                                                  
-         -1 +.POS     \ Decrement current cursor position by one  
-         BL  ECHO     \ Store a blank and echo to console.        
-         -1 +.POS ;   \ Echo incremented cursor position by one   
-                      \ so we must decrement by one again.        
-                                                                  
-                                                                  
-10                                                                  
-11                                                                  
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 12 not modified      
- 0 \ MEOL                                         09:49JWB02/07/86  
-                                                                  
- 2 : MEOL  ( --   -- )     \ Move to end of line.                   
-                                                                  
-         %BUF @ %MLEN @  \ Get address and length of line buffer. 
-         -TRAILING       \ Leave length excluding trailing spaces 
-         %MLEN @ 1- MIN  \ Leave line buffer length minus one     
-                         \ or string length whichever is smaller. 
-         !POS DROP .POS  \ Move cursor to that position.          
-         %MOD OFF ;      \ Turn off insert mode.                  
-10                                                                  
-11                                                                  
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 13 not modified      
- 0 \ DEOL  DEALL                                  09:49JWB02/07/86  
-                                                                  
- 2 : DEOL  ( --   -- )     \ Delete to end of field.                
-                                                                  
-         POS@  #R   \ Get cursor position leaving number of       
-                    \ characters to right of cursor.              
-         BL FILL    \ Blanks from right of cursor to end of line. 
-         .LIN ;     \ Update entire line.                         
-                                                                  
-                                                                  
-10 : DEALL ( --   -- )     \ Delete entire line.                    
-11                                                                  
-12         %BUF @ %MLEN @  \ Get address and length of line buffer. 
-13         BL FILL         \ Fill line with blanks.                 
-14         .LIN            \ Update entire line.                    
-15         HOM ;           \ Move cursor to beginning of line.      
- 
- 
-Screen 14 not modified      
- 0 \ DCHAR                                        09:49JWB02/07/86  
-                                                                  
- 2 \ Delete character at cursor position and close gap created.     
- 3 : DCHAR ( --   -- )                                              
-                                                                  
-         POS@ 1+ POS@            \ From adr and To adr            
-         #R MOVE                 \ Number to move, move string    
-         BL %BUF @ %MLEN @ 1- + C! \ Put blank in line buf at eol 
-         POS@ #R -TRAILING       \ Cursor position and number of  
-                                 \ char less trailing blanks.     
-10         1+ CTYPE                \ Add one to cursor and send     
-11         .POS ;                  \ string to console. Move cursor 
-12                                 \ to current position.           
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 15 not modified      
- 0 \ ICHAR                                        09:49JWB02/07/86  
-                                                                  
- 2 \ Insert character char  at current position and update display. 
- 3 : ICHAR ( char   -- )                                            
-                                                                  
-         #R >R POS@ DUP R@ + 1- C@ BL =  \ Blank at end of line?  
-         IF   DUP 1+  R@ 1-      \ Yes, set up from adr to adr.   
-              MOVE POS@ C!       \ Move string, insert character. 
-              POS@ R@ -TRAILING  \ Strip off trailing blanks.     
-              CTYPE   1 +.POS    \ Output to console and move     
-10                                 \ cursor one to right.           
-11         ELSE BEEP 2DROP         \ No, beep then clean up stack.  
-12         THEN R> DROP ;          \ Clean up return and parameter  
-13                                 \ stack.                         
-14                                                                  
-15                                                                  
- 
- 
-Screen 16 not modified      
- 0 \ OVER-STRIKE  INSERT                          09:49JWB02/07/86  
-                                                                  
- 2 : OVER-STRIKE ( --  -- )  \ Set over-strike mode.                
-                                                                  
-   %MOD @ IF             \ If insert mode then                    
-   LITTLE-CURSOR         \ set cursor to small                    
-   %MOD OFF              \ set over-strike mode                   
-   THEN ;                \ otherwise continue.                    
-                                                                  
-                                                                  
-10 : INSERT     ( --  -- )   \ Set insert mode.                     
-11                                                                  
-12   %MOD @ NOT IF         \ If over-strike mode then               
-13   BIG-CURSOR            \ set cursor to large                    
-14   %MOD ON               \ set insert mode                        
-15   THEN ;                \ otherwise continue.                    
- 
- 
-Screen 17 not modified      
- 0 \ L-ARROW  R-ARROW  CLR                        09:49JWB02/07/86  
-                                                                  
- 2 : L-ARROW  ( --  -- )      \ Move cursor left one position.      
-         -1 +.POS OVER-STRIKE ;                                   
-                                                                  
- 5 : R-ARROW  ( --  -- )      \ Move cursor right one position.     
-         1 +.POS OVER-STRIKE ;                                    
-                                                                  
-                                                                  
- 9 : CLR  ( --  -- )          \ Clear screen, & redisplay at home.  
-10                                                                  
-11   0 0 79 24 15 INIT-WINDOW  \ Clear screen.                      
-12   %ROW OFF   .LIN ;        \ Update entire first line.           
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 18 not modified      
- 0 \ INSS  +TRANS   -TRANS                        10:05JWB02/07/86  
-                                                                  
- 2 : INSS ( --  -- )          \ Insert/overstrike  toggle.          
-    %MOD @ IF  OVER-STRIKE  ELSE  INSERT THEN ;                   
-                                                                  
- 5 : +TRANS ( --  -- )    \                                         
-         %POS @ %MLEN @ 1- <     \ Cursor at end of line?         
-         IF  POS@  @ 256 /MOD    \ Transpose two char at cursor.  
-             ECHO  ECHO          \ Echo and store both char.      
-             L-ARROW             \ Reposition cursor.             
-10         THEN ;                  \                                
-11                                                                  
-12                                                                  
-13 : -TRANS ( --  -- )                                              
-14         %POS @                                                   
-15         IF -1 +.POS  +TRANS L-ARROW  THEN ;                      
- 
- 
-Screen 19 not modified      
- 0 \ BK.PTR  PR.PTR                               09:50JWB02/07/86  
- 1 256 CONSTANT BK.SIZE    \ Size of command line backup buffer.    
-     VARIABLE BK.PTR     \ Pointer to top of backup buffer.       
-     VARIABLE PR.PTR     \ Pointer to previous line in bkup buf.  
-     CREATE   BK.BUF  BK.SIZE ALLOT    \ This is the backup buf.  
- 5 \ Leave address of the top of the backup buffer.                 
- 6 : BK.ADR ( --  adr )                                             
-         BK.BUF  BK.PTR @ + ;                                     
-                                                                  
- 9 \ Increment pointer to top of backup buffer by n.                
-10 : +BK.PTR ( n  -- ) BK.PTR +! ;                                  
-11 \ Leave address of the previous line.                            
-12 : PR.ADR ( --  adr )                                             
-13         BK.BUF  PR.PTR @ + ;                                     
-14 \ Increment pointer to previous line by n.                       
-15 : +PR.PTR ( n  -- )  PR.PTR +! ;                                 
- 
- 
-Screen 20 not modified      
- 0 \ DELETE-1ST-LINE  NO-ROOM?  MAKE-ROOM         09:50JWB02/07/86  
- 1 \ Delete first line in backup buffer and adjust pointer counts.  
- 2 : DELETE-1ST-LINE ( --  -- )                                     
-         BK.BUF 1+ C@ 2+ >R                                       
-         BK.BUF R@ + BK.BUF  BK.PTR @ R@ - CMOVE                  
-         R> NEGATE DUP +BK.PTR  +PR.PTR  ;                        
-                                                                  
- 7 \ Leave a true flag if there is no room for string of size n.    
- 8 : NO-ROOM?  ( n   flag )                                         
-        2+ BK.SIZE  BK.PTR @  -  <  NOT ;                         
-10                                                                  
-11 \ Delete lines till there is room for string of size n.          
-12 : MAKE-ROOM ( n   -- )                                           
-13         BEGIN  DUP  NO-ROOM?                                     
-14         WHILE  DELETE-1ST-LINE                                   
-15         REPEAT DROP ;                                            
- 
- 
-Screen 21 not modified      
- 0 \ SAVE-LINE                                    09:50JWB02/07/86  
-   VARIABLE   RLFLAG                                              
-                                                                  
- 3 : RLFLAG?  RLFLAG @ ;                                            
-                                                                  
- 5 \ Save current line in the backup buffer.                        
- 6 : SAVE-LINE ( --  -- )                                           
-    %BUF @ %MLEN @ -TRAILING ?DUP        \ adr & count of line    
-    IF   DUP MAKE-ROOM                   \ Make room if required  
-         BK.ADR OFF  DUP BK.ADR 1+ C!    \ Save line count.       
-10         TUCK BK.ADR 2+ SWAP CMOVE       \ Move the line.         
-11         2+   +BK.PTR                    \ Update pointers.       
-12         BK.PTR @ PR.PTR !                                        
-13         RLFLAG  ON                                               
-14    ELSE DROP  THEN  ;                                            
-15                                                                  
- 
- 
-Screen 22 not modified      
- 0 \ <LINE   >LINE                                09:50JWB02/07/86  
- 1 \ Decrement previous line pointer to start of the previous line. 
- 2 : <LINE    ( -- -- )                                             
-         PR.PTR @ 0 <=                   \ At bottom of bkup buf? 
-         IF   BK.PTR @ PR.PTR !  THEN    \ If so point to top!!   
-         BEGIN -1 +PR.PTR  PR.ADR C@     \ Now back up one line.  
-         0= UNTIL ;                                               
-                                                                  
- 8 \ Increment previous line pointer to start of the next line.     
- 9 : >LINE    ( --  -- )                                            
-10         PR.PTR @  BK.PTR @ <            \ Not at top of bk buf?  
-11         IF BEGIN  1 +PR.PTR  PR.ADR C@  \ Then move forward one  
-12            0= UNTIL                     \ line in bkup buf.      
-13         THEN                                                     
-14         PR.PTR @ BK.PTR @ >=            \ Did we reach the top?  
-15         IF PR.PTR OFF  THEN  ;          \ If so point to bottom. 
- 
- 
-Screen 23 not modified      
- 0 \ RECALL-LINE  -RECALL-LINE +RECALL-LINE       11:27JWB11/23/85  
- 1 \ Move previous line to the editing buffer.                      
- 2 : RECALL-LINE ( --  -- )                                         
-       %BUF @ %MLEN @ BL FILL            \ Clear editing buffer.  
-       RLFLAG?                                                    
-       IF    PR.ADR  1+                                           
-             COUNT %MLEN @ MIN   \ From adr and count.            
-             %BUF @ SWAP CMOVE   \ To adr and moveit.             
-       THEN .LIN MEOL   ;        \ Display & move to end.         
- 9 \ Back up one line and move it to editing buffer.                
-10 : -RECALL-LINE ( --  -- )                                        
-11    RLFLAG? IF <LINE THEN   RECALL-LINE ;                         
-12 \ Move forward one line then move it to the editing buffer.      
-13 : +RECALL-LINE ( --  -- )                                        
-14    RLFLAG? IF >LINE THEN  RECALL-LINE ;                          
-15                                                                  
- 
- 
-Screen 24 not modified      
- 0 \ Read screen location.  SC@                   18:06JWB11/25/85  
- 1 ALSO                                                             
- 2 CODE  SC@   ( --  char )                                         
-         8 #  AH MOV                                              
-           BH BH SUB 16 INT AH AH SUB                             
-        128 # AX CMP                                              
- 6 U>= IF  32 # AL MOV  THEN                                        
-         31 # AX CMP                                              
- 8 U<  IF  32 # AL MOV  THEN                                        
-                 1PUSH END-CODE  PREVIOUS                         
-10 : +MARK  ( n  -- )                                               
-11         CUR@ 0 ROT  AT ATRIB @ SC@                               
-12         112 ATRIB ! VEMIT ATRIB ! CUR! ;                         
-13 : -MARK  ( n  -- )                                               
-14         CUR@ 0 ROT  AT SC@  VEMIT   CUR! ;                       
-15                                                                  
- 
- 
-Screen 25 not modified      
- 0 \  READ-SCREEN                                 15:21JWB11/25/85  
-  VARIABLE SLINE                                                  
- 2 : SINC   SLINE @ 1+   25 MOD SLINE ! ;                           
- 3 : SDEC   SLINE @ 24 + 25 MOD SLINE ! ;                           
-                                                                  
-  CREATE SLINE-BUF   80 ALLOT                                     
-                                                                  
- 7 \ Copy line n of screen into SLINE-BUF .                         
- 8 : READ-SCREEN  ( n  -- )                                         
-         25 MOD  CUR@ >R                                          
-10         80 0 DO  I OVER AT SC@                                   
-11                  SLINE-BUF I + C!                                
-12              LOOP  DROP                                          
-13         R> CUR!  ;                                               
-14                                                                  
-15                                                                  
- 
- 
-Screen 26 not modified      
- 0 \                                              09:50JWB02/07/86  
- 1 \ Recall next line from screen.                                  
- 2 : +RECALL-SLINE  ( --  -- )                                      
-    NO-CURSOR                                                     
-    SLINE @ -MARK SINC SLINE @ DUP +MARK READ-SCREEN              
-    %BUF @ %MLEN @ BL FILL                                        
-    SLINE-BUF 79 -TRAILING %MLEN @ MIN %BUF @ SWAP CMOVE          
-    .LIN  MEOL  LITTLE-CURSOR ;                                   
-                                                                  
- 9 \ Recall previous line from screen.                              
-10 : -RECALL-SLINE ( --  -- )                                       
-11    NO-CURSOR                                                     
-12    SLINE @ -MARK SDEC SLINE @ DUP +MARK READ-SCREEN              
-13    %BUF @ %MLEN @ BL FILL                                        
-14    SLINE-BUF 79 -TRAILING %MLEN @ MIN %BUF @ SWAP CMOVE          
-15    .LIN  MEOL LITTLE-CURSOR ;                                    
- 
- 
-Screen 27 not modified      
- 0 \  F-WORD B-WORD                               13:42JWB03/03/87  
-  : F-WORD  ( --  -- )                                            
-         BEGIN   POS@ C@ BL <>                                    
-         WHILE   1 +POS   REPEAT                                  
-         BEGIN   POS@ C@ BL =                                     
-         WHILE   1 +POS   REPEAT  .POS ;                          
-                                                                  
-  : B-WORD ( --  -- )                                             
-         BEGIN  POS@ C@ BL <>                                     
-         WHILE  -1 +POS  REPEAT                                   
-10         BEGIN  POS@ C@ BL =                                      
-11         WHILE  -1 +POS  REPEAT                                   
-12         BEGIN  POS@ C@ BL <>                                     
-13         WHILE  -1 +POS  REPEAT                                   
-14         1 +.POS ;                                                
-15                                                                  
- 
- 
-Screen 28 not modified      
- 0 \  D-WORD  F-CHAR                              14:32JWB03/03/87  
-  : D-WORD ( --  -- )                                             
-         POS@ C@ BL <> IF                                         
-         BEGIN  POS@ C@ BL <>                                     
-         WHILE  -1 +POS  REPEAT                                   
-         1 +POS .POS                                              
-         BEGIN  POS@ C@ BL <>                                     
-         WHILE  DCHAR                                             
-         REPEAT DCHAR  THEN ;                                     
-                                                                  
-10 : PCKEY ( --   n flag )                                          
-11         {KEY}                                                    
-12             ?DUP IF TRUE ELSE {KEY} FALSE THEN ;                 
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 29 not modified      
- 0 \                                              14:33JWB03/03/87  
- 1 \ Clear backup buffer.                                           
- 2 : CLR.BK.BUF ( --  -- )                                          
-   RLFLAG  OFF                                                    
-   BK.BUF BK.SIZE BL FILL                                         
-   BK.PTR OFF PR.PTR OFF ;                                        
-                                                                  
-  : F-CHAR  ( --   -- )                                           
-         PCKEY                                                    
-         IF  %MLEN @ %POS @ 1+                                    
-10             DO I %BUF @ + C@ OVER =                              
-11                IF  I !POS LEAVE THEN                             
-12             LOOP  .POS                                           
-13         THEN DROP ;                                              
-14                                                                  
-15                                                                  
- 
- 
-Screen 30 not modified      
- 0 \  RET  PCKEY                                  14:24JWB03/03/87  
- 1 : DBOL  ( --  -- )                                               
-     SLINE-BUF 80 BL FILL                                         
-     POS@ SLINE-BUF #R DUP >R CMOVE                               
-     %BUF @ %MLEN @ BL FILL                                       
-     SLINE-BUF %BUF @ R> CMOVE .LIN  HOM ;                        
-                                                                  
-                                                                  
- 8 : RET   ( --   -- )     \ Finished, move to eol, set %DONE ON    
-        SLINE @  -MARK  MEOL  %DONE ON OVER-STRIKE  ;             
-10                                                                  
-11                                                                  
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 31 not modified      
- 0 \ CTRL.KEY                                     14:17JWB03/03/87  
- 1 : CTRL.KEY                                                       
-         CASE                                                     
- 3 CONTROL M OF RET                     ENDOF                       
- 4 CONTROL H OF RUB                     ENDOF                       
- 5 CONTROL L OF CLR                     ENDOF                       
- 6 CONTROL Q OF F-CHAR                  ENDOF                       
- 7 CONTROL S OF L-ARROW                 ENDOF                       
- 8 CONTROL T OF D-WORD                  ENDOF                       
- 9 CONTROL D OF R-ARROW                 ENDOF                       
-10 CONTROL I OF 5 +.POS OVER-STRIKE     ENDOF                       
-11 CONTROL U OF DEALL                   ENDOF                       
-12        27 OF DEALL                   ENDOF                       
-13 CONTROL X OF DEOL                    ENDOF                       
-14         ( OTHERS ) ( BEEP )                                      
-15         ENDCASE ;                                                
- 
- 
-Screen 32 not modified      
- 0 \  FUNC.KEY                                    09:51JWB02/07/86  
-                                                                  
- 2 : FUNC.KEY                                                       
-         CASE                                                     
-   31 OF  -TRANS         ENDOF       32 OF  +TRANS         ENDOF  
-   75 OF  L-ARROW        ENDOF       77 OF  R-ARROW        ENDOF  
-   71 OF  HOM            ENDOF       79 OF  MEOL           ENDOF  
-   81 OF  +RECALL-LINE   ENDOF       73 OF  -RECALL-LINE   ENDOF  
-   83 OF  DCHAR          ENDOF       82 OF  INSS           ENDOF  
-   80 OF  +RECALL-SLINE  ENDOF       72 OF  -RECALL-SLINE  ENDOF  
-10  117 OF  DEOL           ENDOF      119 OF  DBOL           ENDOF  
-11  115 OF  B-WORD         ENDOF      116 OF  F-WORD         ENDOF  
-12  132 OF  CLR.BK.BUF     ENDOF                                    
-13         ( OTHERS ) ( BEEP )                                      
-14         ENDCASE ;                                                
-15                                                                  
- 
- 
-Screen 33 not modified      
- 0 \ (LEDIT)                                      09:51JWB02/07/86  
- 1 \ Edit line of length len at address adr. If flag is true move   
- 2 \ to beginning of line, if false move to end of line.            
- 3 : (LEDIT)  ( adr len flag   -- )                                 
-         -ROT 79 MIN 2DUP %MLEN ! %BUF !                          
-         %POS OFF  %DONE OFF   7 ATRIB !                          
-         CUR@ 256 /MOD  %ROW !  %OFF !                            
-         -TRAILING CTYPE IF HOM ELSE MEOL THEN                    
-         BEGIN PCKEY 2DUP FLIP + LKEY !                           
-         IF   DUP  31 < IF  CTRL.KEY                              
-10                        ELSE %MOD @ IF ICHAR ELSE ECHO THEN THEN  
-11         ELSE FUNC.KEY  THEN                                      
-12         %DONE @ UNTIL SAVE-LINE  ;                               
-13                                                                  
-14                                                                  
-15                                                                  
- 
- 
-Screen 34 not modified      
- 0 \  LEDIT  <LEDIT  <EXPECT>                     09:51JWB02/07/86  
- 1 ALSO FORTH DEFINITIONS                                           
-                                                                  
- 3 \ Edit line of length n at adr. Begin by displaying string at    
- 4 \ adr and then sit cursor at end of string.                      
- 5 : LEDIT ( adr n   -- )                                           
-         FALSE (LEDIT) ;                                          
- 7 \ As above, but put cursor at beginning of line.                 
- 8 : <LEDIT ( adr n   -- )                                          
-         TRUE (LEDIT) ;                                           
-10                                                                  
-11 : <EXPECT> ( adr n   -- )                                        
-12         2DUP BL FILL 2DUP <LEDIT -TRAILING                       
-13         PRINTING @ IF 2DUP HOM TYPE THEN                         
-14         DUP SPAN !  #OUT ! DROP SPACE ;                          
-15                                                                  
- 
- 
-Screen 35 not modified      
- 0 \ NEW-EXP  OLD-EXP                             09:51JWB02/07/86  
- 1 : NEW-EXP  ['] <EXPECT> ['] EXPECT 2+ !                          
-            ['] EXIT     ['] EXPECT 4 + ! ;                       
-                                                                  
- 4 : OLD-EXP  ['] DUP      ['] EXPECT 2+ !                          
-            ['] SPAN     ['] EXPECT 4 + ! ;                       
-                                                                  
- 7 ONLY FORTH ALSO                                                  
-                                                                  
-                                                                  
-10                                                                  
-11                                                                  
-12                                                                  
-13                                                                  
-14                                                                  
-15                                                                  
- 
-</code> 
papierkorb/ledit.blk.1755359401.txt.gz · Zuletzt geändert: 2025-08-16 17:50 von mka