I just finished the attached lisp routine to edit and insert *.txt files, if you execute the function with the text file also attached as an example you will see the "-" at the end of line 11. Any ideas on how to get rid if this in this example?
Bruce
edit added code (sorry forgot)
(defun c:ednotes (/ fileloc ext ftitle filenm pt1 filen linetext cnt nmb FileE edit insert dclfile allngth ollngth)
(setq dclfile "c:\\program files\\septic assistant\\note files\\temp.dcl")
(setq fileloc "c:\\program files\\septic assistant\\note files\\General Notes")
(setq ext "txt")
(defun createdcl (/ )
(setq FileE(open dclfile "w"))
(write-line "ednotes: dialog {label = \"Edit / Insert Std Notes ?\";: boxed_row {: row {: button {label= \"Edit\";key = \"edit\";is_cancel
= true;width = 10;fixed_width = true;}: button {label= \"Insert\";key = \"insert\";is_cancel = true;width = 10;fixed_width = true
;}: button {label = \"Cancel\";is_cancel = true;key = \"cancel\";width = 4;fixed_width = true;}}}: text {label =
\"Septic Assistant - 2011\";alignment = centered; }}" FileE)
(close FileE)
);end of function
(defun calldcl (/ dcl_id)
(setq dcl_id(load_dialog dclfile))
(new_dialog "ednotes" dcl_id)
(set_tile "edit" "0")
(action_tile "edit" "(setq edit $value)")
(mode_tile "insert" 2)
(set_tile "insert" "0")
(action_tile "insert" "(setq insert $value)")
(action_tile "cancel" "(deldcl)(end)")
(start_dialog )
(unload_dialog dcl_id)
);end of function
(defun end (/ )
(princ "\n- Function Cancelled. - ")
(exit)
);defun
(defun deldcl (/ )
(vl-file-delete dclfile)
)
(defun mltline (/ #lns lcnt mlinetext stline)
(setq #lns (/ allngth ollngth))
(if (/= #lns (fix #lns))
(setq #lns (+ (fix #lns) 1))
);if
(setq lcnt 0)
(while (/= lcnt #lns)
(setq stline (+(* lcnt (fix ollngth))1))
(if (= lcnt 0)
(setq mlinetext (strcat (itoa nmb)".- " (substr linetext stline (fix ollngth))"-"))
(if (/= (- #lns 1) lcnt)
(setq mlinetext (strcat " " (substr linetext stline (fix ollngth))"-"))
(setq mlinetext (strcat " " (substr linetext stline (fix ollngth))))
);if
);if
(command "text" "" mlinetext )
(setq lcnt (+ 1 lcnt))
);while end of function
);end of function
(defun insertt (/ )
(setq pt1 (getpoint "Starting Point of Text;"))
(setq FileN(open filenm "r"))
(setq ollngth(float(atoi (read-line FileN))))
(setq linetext(read-line FileN))
(command "text" pt1 "0" linetext )
(setq nmb 0)
(setq cnt 1)
(while (= cnt 1)
(setq nmb(+ nmb 1))
(setq linetext (read-line FileN))
(if (= linetext nil)
(progn
(setq cnt 2)
(Close FileN)
);progn
(progn
(if (< (setq allngth(strlen linetext)) ollngth)
(progn
(setq linetext(strcat (itoa nmb)".- " linetext))
(command "text" "" linetext )
);progn
(mltline)
);if
);progn
);if
);while
);end of function
(setq ftitle "Note Files Available for Editing and Inserting")
(setq filenm (getfiled ftitle fileloc ext 0))
(createdcl)
(calldcl)
(if (= edit "1")
(progn
(command "start" (strcat "notepad " filenm))
(calldcl)
(if (= insert "1")
(insertt)
);if
);progn
(insertt)
);if
(deldcl)
(princ "\n - Function Successfully Completed -")
(princ)
);end of function