TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Bob Wahr on May 30, 2008, 10:46:36 AM

Title: How do you joing parts of a string together in lisp?
Post by: Bob Wahr on May 30, 2008, 10:46:36 AM
What I want
Code: [Select]
Sub TEST()
Dim nomen As String
Dim adicio As String
nomen = ThisDrawing.GetVariable("LOGINNAME")
adicio = "p:\acad\drafters\" & nomen & "\support"
End Sub

What isn't working
Code: [Select]
(defun c:TETHT()
    (setq strname (getvar "LOGINNAME"))
    (addsupportpath "P:\\acad\\drafters\\"strname"\\support" nil) ;with or without spaces or &s
(princ))
Title: Re: How do you joing parts of a string together in lisp?
Post by: Keith™ on May 30, 2008, 10:53:43 AM
I think strcat is what you are looking for


Code: [Select]
(defun c:TETHT()
    (setq strname (getvar "LOGINNAME"))
    (addsupportpath (strcat "P:\\acad\\drafters\\" strname "\\support" ) nil) ;with or without spaces or &s
(princ))
Title: Re: How do you joing parts of a string together in lisp?
Post by: Bob Wahr on May 30, 2008, 10:59:00 AM
That's the one.  Thanks.

Trying to get back into some lisp after WTF too many years off.  Should probably find a "Autolisp for freaking morons" book.
Title: Re: How do you joing parts of a string together in lisp?
Post by: Keith™ on May 30, 2008, 11:00:54 AM
we have a forum dedicated to that ... :D
Title: Re: How do you joing parts of a string together in lisp?
Post by: JohnK on May 30, 2008, 11:34:37 AM
A little gem i found a little bit ago i think is absolute genius!
http://www.theswamp.org/~stig/string#4.2.1
Title: Re: How do you joing parts of a string together in lisp?
Post by: DEVITG on June 01, 2008, 11:51:59 AM
That's the one.  Thanks.

Trying to get back into some lisp after WTF too many years off.  Should probably find a "Autolisp for freaking morons" book.


My first ABC lisp book

http://ronleigh.info/autolisp/index.htm