papierkorb:edit.blk
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| papierkorb:edit.blk [2025-08-16 17:50] – ↷ Seite von projects:edit.blk nach papierkorb:edit.blk verschoben mka | papierkorb:edit.blk [Unbekanntes Datum] (aktuell) – gelöscht - Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1 | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ===Number input and editing words=== | ||
| - | < | ||
| - | 1 list Screen 1 not modified | ||
| - | 0 \ 14: | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | 2 list Screen 2 not modified | ||
| - | 0 \ ANY-SIGN? | ||
| - | 1 ONLY EDITOR ALSO FORTH DEFINITIONS | ||
| - | 2 \ Leave a true flag if string begins with a -ve sign. | ||
| - | 3 \ Note we assume a counted string!! | ||
| - | 4 \ the first string character. | ||
| - | 5 : ANY-SIGN? ( adr | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 THEN ; | ||
| - | 12 \ Move up to first non blank of string. | ||
| - | 13 \ to position before first non blank!! | ||
| - | 14 : SKIP-BLANKS ( adr adr' ) | ||
| - | 15 BEGIN 1+ DUP C@ BL <> UNTIL 1- ; | ||
| - | |||
| - | 3 list Screen 3 not modified | ||
| - | 0 \ ED_CONVERT | ||
| - | 1 \ This routine edits a string and converts to double number. | ||
| - | 2 : ED_CONVERT | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 WHILE 0 REPEAT | ||
| - | 11 C@ BL <> | ||
| - | 12 WHILE 2DROP R> DROP BEEP \ c a n | ||
| - | 13 ASCII ? 2 PICK C! ROT \ a n c | ||
| - | 14 | ||
| - | 15 DPL @ 0< IF DPL OFF THEN ; \ DPL=0 if .pt not entered | ||
| - | |||
| - | 4 list Screen 4 not modified | ||
| - | 0 \ (#ED) 14: | ||
| - | 1 \ Fetch a double number using field with of n using adr for | ||
| - | 2 \ and input buffer. | ||
| - | 3 \ required to repeat until he makes a valid number. | ||
| - | 4 : (#ED) ( adr n dn ) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 | ||
| - | 11 | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | 5 list Screen 5 not modified | ||
| - | 0 \ D#ED WD#ED 13: | ||
| - | | ||
| - | 2 \ Edit double number at current cursor position using default | ||
| - | 3 \ field with of 12. Input buffer is at PAD | ||
| - | 4 : D#ED ( adr -- ) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 9 \ As above but field width is specified on the stack. | ||
| - | 10 : WD#ED ( adr w -- ) | ||
| - | 11 > | ||
| - | 12 DUP 2@ TUCK DABS <# #S ROT SIGN #> | ||
| - | 13 PAD R@ CHFL FILL | ||
| - | 14 PAD SWAP CMOVE | ||
| - | 15 | ||
| - | |||
| - | 6 list Screen 6 not modified | ||
| - | 0 \ XYWD# | ||
| - | 1 \ As above but cursor & field width are specified on the stack. | ||
| - | 2 : XYWD# | ||
| - | | ||
| - | | ||
| - | | ||
| - | 6 \ Edit single number a current cursor position using default | ||
| - | 7 \ field with of 6. Edit buffer is at PAD | ||
| - | 8 : S#ED ( adr -- ) | ||
| - | | ||
| - | 10 PAD 6 CHFL FILL | ||
| - | 11 PAD SWAP CMOVE | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | 7 list Screen 7 not modified | ||
| - | 0 \ WS#ED XYWS# | ||
| - | 1 \ As above but field width is specified on the stack. | ||
| - | 2 : WS#ED ( adr w -- ) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 9 \ As above but cursor & field width are specified on the stack. | ||
| - | 10 : XYWS# | ||
| - | 11 -ROT AT WS#ED ; | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | 8 list Screen 8 not modified | ||
| - | 0 \ IN_CONVERT | ||
| - | 1 \ This routine inputs a string and converts to double number. | ||
| - | 2 : IN_CONVERT | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 WHILE 0 REPEAT | ||
| - | 11 C@ BL <> | ||
| - | 12 WHILE 2DROP R> DROP BEEP \ c a n | ||
| - | 13 ASCII ? 2 PICK C! ROT \ a n c | ||
| - | 14 | ||
| - | 15 DPL @ 0< IF DPL OFF THEN ; \ DPL=0 if .pt not entered | ||
| - | |||
| - | 9 list Screen 9 not modified | ||
| - | 0 \ (#IN) 14: | ||
| - | 1 \ Fetch a double number using field with of n using adr for | ||
| - | 2 \ and input buffer. | ||
| - | 3 \ required to repeat until he makes a valid number. | ||
| - | 4 : (#IN) ( adr n dn ) | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | | ||
| - | 10 1+ ROT + CUR! \ Restore cursor. | ||
| - | 11 DROP R> R> ; \ Recover our number. | ||
| - | 12 | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | 10 list Screen 10 not modified | ||
| - | 0 \ D#IN WD#IN XYWD# | ||
| - | 1 \ Input double number a current cursor position using default | ||
| - | 2 \ field with of 6. Input buffer is at PAD | ||
| - | 3 : D#IN ( -- dn ) | ||
| - | | ||
| - | | ||
| - | 6 \ As above but field width is specified on the stack. | ||
| - | 7 : WD#IN ( n dn ) | ||
| - | | ||
| - | | ||
| - | 10 \ As above but cursor position is also specified on the stack. | ||
| - | 11 : XYWD#IN ( x y n dn ) | ||
| - | 12 -ROT AT WD#IN ; | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | 11 list Screen 11 not modified | ||
| - | 0 \ S#IN WS#IN XYS# | ||
| - | 1 \ Input single number a current cursor position using default | ||
| - | 2 \ field with of 6. Input buffer is at PAD | ||
| - | 3 : S#IN ( -- dn ) | ||
| - | | ||
| - | | ||
| - | 6 \ As above but field width is specified on the stack. | ||
| - | 7 : WS#IN ( n dn ) | ||
| - | | ||
| - | | ||
| - | 10 \ As above but cursor position is also specified on the stack. | ||
| - | 11 : XYS#IN ( x y n dn ) | ||
| - | 12 -ROT AT WS#IN ; | ||
| - | 13 | ||
| - | 14 | ||
| - | 15 | ||
| - | |||
| - | |||
| - | </ | ||
papierkorb/edit.blk.1755359401.txt.gz · Zuletzt geändert: 2025-08-16 17:50 von mka