Code Red > AutoLISP (Vanilla / Visual)

Editor with configurable formatting

(1/3) > >>

hmspe:
Any suggestions?  I've been using the vlide editor for formatting  and TextPad for coding.  I'm trying to rework some older code that's in all sorts of different formats and am trying to get everything into a common format.  The specific problem in the vlide editor is that I'm getting

   (progn  (defun list->variantArray

when I reformat when I want

   (progn
     (defun list->variantArray

No luck on finding anything useful on the web.  Is there a configuration file for the vlide editor beyond the few settings under Options?  Or an editor, add-on, or routine that's configurable?

Thanks for any suggestions.

Martin

T.Willey:
You can see if this will work for you.  [>LINK<]

CAB:
The problem & I've had it too is that sometimes you get lisp code without any Carriage Returns in the text.
The result is a long string of text & VLIDE will not add the CRLF to the existing code.
The problem is that you need a list of functions that would signal where the CRLF is to be added.

Vlide does nothing with this code:
(defun C:TEST () (progn (princ "XXX") (setq A (+ 1 (/ 25 2) 6))))
but if you add the CRLF then VLIDE will format the code.

Just imagine you got this code"

--- Code: ---(setq Opt (getkword "\n <C>urrent, or enter to do multiply: "))(if (/= Opt "Current") (progn  (if (> (vla-get-Count (vla-get-Documents AcadObj)) 1) (prong (alert " Close all but one drawing and run again. ")    (exit)   )  )  (if (/= (getvar "dbmod") 0)   (progn  (initget "Y N") (setq SaveOpt (getkword "\n Drawing has changed.  Save changes before exiting drawings? <Y> ")) (if (or (= SaveOpt "Y") (not SaveOpt)) (setq SaveOpt "N")     (setq SaveOpt "Y")    )   )  ) ))(setq CurDate (rtos (getvar "cdate") 2 4))(setq RevDate (strcat (substr CurDate 5 2)"/"(substr CurDate 7 2)"/"(substr CurDate 3 2)))(setq DiaLoad (load_dialog "3m-Rev.dcl"))(if (not (new_dialog "MMMREV" DiaLoad))(exit))(set_tile "RevDate" RevDate)(set_tile "RevDwnBy" "TMW")(mode_tile "RevDes" 2)(action_tile "RevDes" "(if (/= (get_tile \"RevDes\") \"\")  (mode_tile \"Accept\" 2) )")(action_tile "Accept" "(progn  (setq RevList (list (get_tile \"RevPrjId\") (get_tile \"RevDate\") (get_tile \"RevDes\") (get_tile \"RevDwnBy\") (get_tile \"RevCkBy\")))  (setq NewRev (get_tile \"AddNewRev\"))  (done_dialog 1) )")(action_tile "OrgIssue" "(progn  (setq RevList (list (get_tile \"RevPrjId\") (get_tile \"RevDate\") '\"ORIGINAL ISSUE\" (get_tile \"RevDwnBy\") (get_tile \"RevCkBy\")))  (setq NewRev (get_tile \"AddNewRev\"))  (done_dialog 2) )")(action_tile "Cancel" "(done_dialog 0)")

--- End code ---
Where woud you add the CRLF?

hmspe:

--- Quote from: T.Willey on January 08, 2008, 11:01:05 AM ---You can see if this will work for you.  [>LINK<]

--- End quote ---

Tim,

Thanks.  I saw your routine when I was looking at options.  I can extend it to do what I want, but was hoping to find a configurable formatting utility that's already coded.  Not a lot of spare time available at the moment, so I don't want to spend time building tools if I can avoid it.  I know back in the days of Turbo Pascal there were "pretty printers" readily available.  I was hoping that there would be the same for Autolisp.

Martin

T.Willey:
I don't want to say then.  I think Michael had some code around that would kind of do what you want, but I'm not sure anymore.

Navigation

[0] Message Index

[#] Next page

Go to full version