; EDST.LSP v1.2 [9/24/90] (c) 1990 David P. Hoekstra ; Additional subroutines for the EDT.LSP text editor ; ------------------------------------------------------------------ ; ; These subroutines may be loaded into memory as needed and unloaded ; to free up memory by EDT.LSP, depending on the state of the EDTM ; global variable. Further explanation of use is found in EDT.LSP ; and EDT.TXT ; ; Distribution information can be found in EDT.LSP ; ;-------------------------------------------------------------------- (prompt "\nLoading EDT routines\n")(defun er (m)(princ "\nerror: ") (princ m)(terpri)(if (not EDTM)(setq ea nil eb nil ec nil ed nil ee nil ef nil eg nil er nil))(repeat 24 (print))(textscr)(write-line "\e[0;75;0;75p") (write-line "\e[0;77;0;77p")(write-line "\e[0;72;0;72p")(write-line "\e[0;80;0;80p") (graphscr)(print)(print)(print)(setq *error* eh)(princ))(defun ea (e / b c i s) (redraw e 3)(setq b nil c 1 i 1 s (cdr (assoc 1 (entget e))))(while (/= b 13)(if (minusp (- i 75))(setq p 1)(setq p (* (fix (1+ (/ (- i 75) 15.0))) 15)))(if (= 1 c) (prompt (strcat "\r" (substr (strcat (substr s 1 (1- i))(chr 219)(substr s (1+ i))) p 79))))(if (= c (/ CURSRBLINK 2))(prompt (strcat "\r" (substr s p 79))))(setq c (1+ c)) (if (= c CURSRBLINK)(setq c 1))(setq d (grread T))(if (= 2 (car d))(setq b (cadr d)) (setq b nil))(cond((= b 8)(ee))((= b 130)(if (<= i (strlen s))(setq i (1+ i))))((= b 129)(if (> i 1)(setq i (1- i))))((= b 127)(setq s (substr s 1 (1- i))))((= b 211) (setq s (strcat (substr s 1 (1- i))(substr s (1+ i)))))((= b 244)(ec))((= b 243) (ed))((= b 245)(setq i (1+ (strlen s))))((= b 247)(setq i 1))((= b 132)(ef 0)) ((= b 246)(ef 1))((= b 27)(setq i 1 s (cdr (assoc 1 (entget e)))))((= b 10)(eg)) ((and (> b 31)(< b 127))(eb))((not b) nil)))(prompt (strcat "\r" (substr s p 79))) (setq e (subst (cons 1 s) (assoc 1 (entget e)) (entget e)))(entmod e))(defun ed ()(if (and (/= i 1)(= (substr s (1- i) 1) " "))(setq i (- i 1)))(while (and (/= i 1) (/= " " b))(setq i (1- i) b (substr s i 1)))(if (= b " ")(setq i (1+ i))))(defun ec () (while (and (/= b " ") (< i (1+ (strlen s))))(setq i (1+ i) b (substr s i 1)))(if (< i (1+ (strlen s)))(setq i (1+ i))))(defun eb ()(setq s (strcat (substr s 1 (1- i)) (chr b) (substr s i)) i (1+ i)))(defun ee ()(if (> i 1)(setq s (strcat (substr s 1 (- i 2)) (substr s i)) i (1- i))))(defun ef (f / g h)(if (= f 0) (setq f nil) (setq f "T"))(setq g i h (1+ i))(while (and (/= " " (substr s g 1))(> g 1)) (setq g (1- g)))(while (and (/= " " (substr s h 1))(<= h (strlen s))) (setq h (1+ h)))(setq s (strcat (substr s 1 g)(strcase (substr s (1+ g) (- h g 1)) f)(substr s h))))(defun eg() (while (and (> k 0) (/= "TEXT" (cdr (assoc 0 (entget (ssname j (1- k)))))))(setq k (1- k)))(if (= 0 k)(setq k (1- k) b 13)(setq k (- k 2) b 13)))