Jump to content

Tcase


Zorg

Recommended Posts

Hey Guys,

 

Im still very limited to what i can do with lisp; recently i've been experimenting with shorting command lengths. I thought i'd make on for the tcase function but you have to click to specify what case you want to make the selected text. Is there a varible for each one of them? (UPPER, lower, Sentance, Title.. ect)

 

Thanks in advance

Link to comment
Share on other sites

Take a look at the tcase.lsp in the Express folder.

 

The mode is stored as a variable, and can be retrieved using:

(acet-getvar '("ACET-TCASE-MODE"))

Link to comment
Share on other sites

couldn't get this to work for upper case, I'm obviously well out of my league :oops::roll:

 

(defun c:tc ( / lst )
(defun acet-tcase-ui-cmd ( / ans def lst )

(setq def (acet-getvar '("ACET-TCASE-MODE")))
(if (not def)
    (setq def "Upper")
);if
(initget "Sentence Lower Upper Title toGgle")
(setq ans (getkword 
           (acet-str-format "\nSelect case [sentence/Lower/Upper/Title/toGgle] <%1>: "
                            def
           )
          );getkword
);setq
(if (not ans)
    (setq ans def)
);if
(acet-setvar (list "ACET-TCASE-MODE" ans 3)) ;; store it in the drawing and in the profile

(list ans)
);defun acet-tcase-ui-cmd
(princ / )

Link to comment
Share on other sites

How are you trying to shorten it - at the moment I thought it is just a dialog and a selection - I don't see where it could be shortened, unless you created a function for each setting in the dialog :)

 

Lee

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...