home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
autocad
/
magic20.arj
/
ED.TXT
< prev
next >
Wrap
Text File
|
1991-10-02
|
6KB
|
170 lines
;;;**************************************************************************
;;; ED.TXT
;;; (C) 1991 by Walt Craig
;;;
;;; A part of the
;;; MAGIC LISP -- AutoLISP ADS Function Library
;;;
;;; Conceived and implemented by:
;;; Walt Craig
;;; May/June 1991
;;;
;;;**************************************************************************
;;; Permission to use, copy, modify, and distribute this software and its
;;; documentation for the purpose of creating applications for AutoCAD, is
;;; hereby granted in accordance with the terms of the stated during
;;; installation.
;;;
;;;**************************************************************************
;;;
;;; WALT CRAIG PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. WALT CRAIG
;;; SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF MERCHANTABILITY OR
;;; FITNESS FOR A PARTICULAR USE. WALT CRAIG DOES NOT WARRANT THAT
;;; THE OPERATION OF THE PROGRAM WILL BE UNNINTERRUPTED OR ERROR FREE.
;;;
;;;**************************************************************************
;;;
;;; RESTRICTED RIGHTS LEGEND
;;;
;;; Use, duplication, or disclosure by the U.S. Government is subject
;;; to restrictions set forth in FAR 52.227-19 (Commerical Computer
;;; Software - Restricted Rights) and DFAR 252.227-7013 (c) (1) (ii)
;;; (Rights in Technical Data and Computer Software), as applicable.
;;;
;;;**************************************************************************
;;;
;;; DESCRIPTION
;;;
;;; ED.TXT is a sample program which illustrates the use of
;;; various MAGIC functions.
;;;
;;; This program will prompt the user for a lisp file to edit. If the
;;; file is found, an editor is called upon passing the lisp file
;;; (no extension) to it.
;;;
;;; Important: This is currently set up for the 'BREIF'editor. You will
;;; have to modify the call to your specific editor with the name
;;; specified in your ACAD.PGP file.
;;;
;;; (load "ed")
;;; ed
;;;
;;;*************************************************************************
;;;* A simple edit loader for lisp ... modify it as you see fit. *
;;;***************************** Variables ***************************
(defun c:ed(/ file lst temp ret dbtest flag strings)
(if WC_
(progn
(setq dbtest (strcat "WC" "_"))
(if(eval(read dbtest)) ;Is this the _debug_ version?
(c:clear);This helps if your doing a lot of KIT programming
)
(if(/= (WC_ ".VERSION") "I V1.5")
(progn
(princ "\nIncompatible SPEED-KIT's");
(grread)
(quit)
)
)
(setvar "cmdecho" 0)
(textscr)
(if (/= (cadr (WC_ ".GETMODE")) 7)
(WC_ ".SETCOLORS"
(list
_WHITE ;forward text color
_BLUE ;<<--- FOR CLS ;background color
_RED ;border background color
_GREEN ;border text color
_BLACK ;hilited text color
_CYAN ;hilited background color
)
))
(setq
_F1 15104
_F10 17408
_ESCKEY 283
_ENTER 7181
_CANCEL 11779
_SPACE 14624
)
(WC_ ".CLS")
(WC_ ".SETNUMERIC" 0)
(WC_ ".SETSPEED" 50)
(WC_ ".WINDOW" 10 12 65 14 1 1)
(WC_ ".RELATIVE" 1)
(WC_ ".DISPLAY" 1 1 "Enter file name: ")
(WC_ ".TITLE" 0 " Lisp Editor Loader ");
(WC_ ".TITLE" 1 " ENTER or SPACE ");
(WC_ ".SETUPBOX" 28 13 63 13)
(WC_ ".SETDENYS" (list _ENTER _ESCKEY _CANCEL _SPACE))
(WC_ ".CLEANUP"); Forces the editor to exept box not window..!
(setq strings '("") flag 't)
(if #edfil
(setq lst (list #edfil));Existing file
(setq lst (list "")) ;New file
)
(while flag
(setq ret(WC_ ".EDIT" lst)
strings(cdr ret)
ret (car ret)
)
(if (or(= ret _ESCKEY)(= ret _CANCEL))
(setq flag nil)
)
(if (/= (nth 0 strings) "")
(setq flag nil)
)
)
(WC_ ".CLS")
(if (or(= ret _ENTER)(= ret _SPACE))
(progn
(setq temp (nth 0 strings))
(if(= temp #edfil)
(command "B" ""); This is because brief remembers!
; ^
; |_________________ YOU'ELL NEED TO MODIFY
; THIS SECTION TO FIT YOUR
; NEEDS.
(progn
(setq #edfil temp)
(command "B" (strcat #edfil ".lsp"));
)
)
(if (not (findfile (strcat #edfil ".lsp")))
(progn
(WC_ ".MESSAGE" (strcat "File: " #edfil ".lsp not found!") 1)
)
(progn
(command(load #edfil))
(WC_ ".MESSAGE" (strcat "The file "#edfil" has been reloaded.") 1)
)
)
)
(WC_ ".CLS")
)
)
(progn
(princ "\nNo SPEED-KIT FOUND!");
)
)
(prin1)
)
(if (not WC_)
(progn
(xload "_DEBUG_")
(if (/= (setq str(WC_ ".VERSION")) "I V1.5")
(progn
(princ "\nIncompatable SPEED-KIT version!");
(xunload "_DEBUG_");
)
(eval(read(WC_ ".WCINIT")))
)
)
(progn
(WC_ ".message" " Type 'ED' to start " 0)
(eval(read(WC_ ".WCINIT")))
)
)
(prin1)