Jump to content

Multiple text lines in alert


Lt Dan's legs

Recommended Posts

I just wanted to have an alert pop up but want multiple lines. How do you make the text return to the right?

 

example:

(alert "Hi /p How are you?")

 

result:

Hi

How are you?

Link to comment
Share on other sites

I just wanted to have an alert pop up but want multiple lines. How do you make the text return to the right?

 

example:

(alert "Hi /p How are you?")

 

result:

Hi

How are you?

If you have list of text lines this will helps

 

 
(defun build_alert (lst / text)
  (alert
    (substr
      (setq text
      (apply 'strcat
      (mapcar
        '(lambda (x)
    (strcat x "\n")
  )
        lst
      )
      )
      )
      1
      (1- (strlen text))
    )
  )
)
;;usage
(build_alert '("alpha" "bravo" "charlie" "delta" "echo" "fixo"))

 

~'J'~

Link to comment
Share on other sites

(defun build_alert ( lst / lst->str )
 (defun lst->str ( lst del )
   (if (cdr lst)
     (strcat (car lst) del (lst->str (cdr lst) del))
     (car lst)
   )
 )
 (alert (lst->str lst "\n"))
)

 

:)

Link to comment
Share on other sites

Thanks guys! I did go with /n

 

How do I add " in LISP?

 

Example: I'm overriding a dim and I'm inputing "w/nx6'-8"h

 

I can get the words in but " throws my routine all off.

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...