Author Topic: How do you joing parts of a string together in lisp?  (Read 2811 times)

0 Members and 1 Guest are viewing this topic.

Bob Wahr

  • Guest
How do you joing parts of a string together in lisp?
« 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))

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: How do you joing parts of a string together in lisp?
« Reply #1 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))
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Bob Wahr

  • Guest
Re: How do you joing parts of a string together in lisp?
« Reply #2 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.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: How do you joing parts of a string together in lisp?
« Reply #3 on: May 30, 2008, 11:00:54 AM »
we have a forum dedicated to that ... :D
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: How do you joing parts of a string together in lisp?
« Reply #4 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
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

DEVITG

  • Bull Frog
  • Posts: 479
Re: How do you joing parts of a string together in lisp?
« Reply #5 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
Location @ Córdoba Argentina Using ACAD 2019  at Window 10