Results 1 to 11 of 11

Thread: string within string

  1. #1
    Kiwi Russ Guest

    string within string

    Hi
    I'm trying to write a few lines of code to make a fas file. The problem
    is the names lisp must have quotation marks around it. How would I insert
    these so that it can then inserted onto the command line?
    Thanks Russ


    (defun C:makefas( / lispname)
    (setq lispname (getstring "\nName of lisp : "))
    (setq lispname (strcat lispname ".lsp"))
    (princ (strcat "(vlisp-compile 'st " lispname ")"))
    (princ)
    );defun

  2. #2
    Rob Taylor Guest
    use \"

    (princ (strcat "(vlisp-compile 'st \"" lispname "\")"))

  3. #3
    Kiwi Russ Guest
    Thanks Rob that did that trick.
    However I have another problem my lisp prints the correct notation in the
    command line but does not want to make a fas file, and I'm not sure why? Any
    ideas anyone?
    thanks Russ
    This is what I have so far.......

    (defun C:makefas( / lispname)
    (setq lispname (getstring "\nName of lisp : "))
    (setq lispname (strcat lispname ".lsp"))
    (princ (strcat "Command:(vlisp-compile 'st \"" lispname "\")"))
    (princ)
    );defun





    "Rob Taylor" <nospam@address.withheld> wrote in message
    news:30228426.1103540602907.JavaMail.jive@jiveforu m2.autodesk.com...
    use \"

    (princ (strcat "(vlisp-compile 'st \"" lispname "\")"))

  4. #4
    Jeff Mishler Guest
    Check what you are having it do.....as it is, you are only printing to the
    command line a string that looks like the result you want....but this works,
    providing the lisp is in the support path.

    (defun C:makefas( / lispname)
    (setq lispname (getstring "\nName of lisp : "))
    (setq lispname (strcat lispname ".lsp"))
    (vlisp-compile 'st lispname )
    (princ)
    );defun


    --
    Jeff
    check out www.cadvault.com
    "Kiwi Russ" <russell@pl.net> wrote in message news:41c7d21b_1@newsprd01...
    Thanks Rob that did that trick.
    However I have another problem my lisp prints the correct notation in the
    command line but does not want to make a fas file, and I'm not sure why?
    Any ideas anyone?
    thanks Russ
    This is what I have so far.......

    (defun C:makefas( / lispname)
    (setq lispname (getstring "\nName of lisp : "))
    (setq lispname (strcat lispname ".lsp"))
    (princ (strcat "Command:(vlisp-compile 'st \"" lispname "\")"))
    (princ)
    );defun





    "Rob Taylor" <nospam@address.withheld> wrote in message
    news:30228426.1103540602907.JavaMail.jive@jiveforu m2.autodesk.com...
    use \"

    (princ (strcat "(vlisp-compile 'st \"" lispname "\")"))

  5. #5
    Kiwi Russ Guest
    Jeff
    perfect that works!!!
    many thanks
    Russ



    "Jeff Mishler" <jeff_m@cadvault.com> wrote in message
    news:41c7d5ff$1_3@newsprd01...
    Check what you are having it do.....as it is, you are only printing to the
    command line a string that looks like the result you want....but this
    works, providing the lisp is in the support path.

    (defun C:makefas( / lispname)
    (setq lispname (getstring "\nName of lisp : "))
    (setq lispname (strcat lispname ".lsp"))
    (vlisp-compile 'st lispname )
    (princ)
    );defun


    --
    Jeff
    check out www.cadvault.com
    "Kiwi Russ" <russell@pl.net> wrote in message news:41c7d21b_1@newsprd01...
    Thanks Rob that did that trick.
    However I have another problem my lisp prints the correct notation in the
    command line but does not want to make a fas file, and I'm not sure why?
    Any ideas anyone?
    thanks Russ
    This is what I have so far.......

    (defun C:makefas( / lispname)
    (setq lispname (getstring "\nName of lisp : "))
    (setq lispname (strcat lispname ".lsp"))
    (princ (strcat "Command:(vlisp-compile 'st \"" lispname "\")"))
    (princ)
    );defun





    "Rob Taylor" <nospam@address.withheld> wrote in message
    news:30228426.1103540602907.JavaMail.jive@jiveforu m2.autodesk.com...
    use \"

    (princ (strcat "(vlisp-compile 'st \"" lispname "\")"))



  6. #6
    Kiwi Russ Guest
    One last question anyone :

    If the lisp does not lie in the support path then I get an error message.
    How would I add some code to turn the below message into an alert box
    message?

    ; *** ERROR Cannot find file test.lsp

    thanks

  7. #7
    Rob Taylor Guest
    use the findfile function like this

    (defun C:makefas( / ); lispname)
    (setq lispname (getstring "\nName of lisp : "))
    (if (findfile (strcat lispname ".lsp"))
    (vlisp-compile 'st lispname )
    (alert (strcat lispname " Not Found.."))
    )
    (princ)
    );defun

  8. #8
    Marc'Antonio Alessi Guest
    I use this, there are some problems switching the
    Vlide and AutoCAD window, maybe somebody can
    help me and you.


    Cheers.


    ; Marc'Antonio Alessi - http://xoomer.virgilio.it/alessi
    ; Function: C:ALE_LispComp
    ;
    ; Note: require DOSLIB
    ;
    ; Description: compile a list of selected files
    ;
    ; Arguments: none
    ;
    ; modify these to your own use:
    ;
    ; (getcfg "AppData/Custom/LispSorg")
    ; (setcfg "AppData/Custom/LispSorg")
    ;
    (defun C:ALE_LispComp ( / CfgPat FilLst FilPat)
    (if
    (or
    (= "" (setq CfgPat (getcfg "AppData/Custom/LispSorg")))
    (null CfgPat)
    (null (vl-file-directory-p CfgPat))
    )
    (setcfg "AppData/Asso/LispSorg" (setq CfgPat (dos_pwdir)))
    )
    (if
    (setq FilLst
    (dos_getfilem
    "Files to compile" CfgPat
    "Lisp files (*.lsp;*.fas)|*.lsp;*.fas|All Files (*.*)|*.*"
    ); I use this filter to see the last compiled FAS
    )
    (progn
    (C:VLISP)
    (setq FilPat (car FilLst) FilLst (cdr FilLst))
    (or
    (= CfgPat FilPat)
    (setcfg "AppData/Custom/LispSorg" FilPat)
    )
    (foreach file FilLst
    (vlisp-compile 'st (strcat FilPat file))
    )
    )
    )
    (princ)
    )

  9. #9
    Kiwi Russ Guest
    Thanks once again Rob! :-)
    Russ

    "Rob Taylor" <nospam@address.withheld> wrote in message
    news:32132866.1103624694911.JavaMail.jive@jiveforu m1.autodesk.com...
    use the findfile function like this

    (defun C:makefas( / ); lispname)
    (setq lispname (getstring "\nName of lisp : "))
    (if (findfile (strcat lispname ".lsp"))
    (vlisp-compile 'st lispname )
    (alert (strcat lispname " Not Found.."))
    )
    (princ)
    );defun

  10. #10
    Kiwi Russ Guest
    Thanks Marc
    thats an interesting mutiple compiler. getcfg and setcfg I am not familar
    with - I must read up about it.
    cheers Russ

    "Marc'Antonio Alessi" <nospam maalessi at tin dot it> wrote in message
    news:41c8532f_1@newsprd01...
    I use this, there are some problems switching the
    Vlide and AutoCAD window, maybe somebody can
    help me and you.


    Cheers.


    ; Marc'Antonio Alessi - http://xoomer.virgilio.it/alessi
    ; Function: C:ALE_LispComp
    ;
    ; Note: require DOSLIB
    ;
    ; Description: compile a list of selected files
    ;
    ; Arguments: none
    ;
    ; modify these to your own use:
    ;
    ; (getcfg "AppData/Custom/LispSorg")
    ; (setcfg "AppData/Custom/LispSorg")
    ;
    (defun C:ALE_LispComp ( / CfgPat FilLst FilPat)
    (if
    (or
    (= "" (setq CfgPat (getcfg "AppData/Custom/LispSorg"))) (null CfgPat)
    (null (vl-file-directory-p CfgPat))
    )
    (setcfg "AppData/Asso/LispSorg" (setq CfgPat (dos_pwdir)))
    )
    (if
    (setq FilLst
    (dos_getfilem
    "Files to compile" CfgPat
    "Lisp files (*.lsp;*.fas)|*.lsp;*.fas|All Files (*.*)|*.*"
    ); I use this filter to see the last compiled FAS
    )
    (progn
    (C:VLISP)
    (setq FilPat (car FilLst) FilLst (cdr FilLst))
    (or
    (= CfgPat FilPat)
    (setcfg "AppData/Custom/LispSorg" FilPat)
    )
    (foreach file FilLst
    (vlisp-compile 'st (strcat FilPat file)) )
    )
    )
    (princ)
    )


  11. #11
    Rob Taylor Guest
    Your welcome Russ.

    I find these forums very useful
    and now I have a makefas routine
    aswell :)

    Merry Xmas All!

    Aussie Rob ;)

Similar Threads

  1. creating string containing quotes (" ")
    By Roland.Fontaine@gmail.com in forum Cadence
    Replies: 4
    Last Post: 05-09-2005, 02:58 PM
  2. String with quotes in it
    By Greg McLandsborough in forum Customization
    Replies: 2
    Last Post: 03-09-2005, 11:17 AM
  3. converting a list to a string
    By Marcel Janmaat in forum Customization
    Replies: 2
    Last Post: 02-24-2005, 06:40 AM
  4. string manipulation
    By john m in forum VBA
    Replies: 4
    Last Post: 12-14-2004, 06:14 PM
  5. action string
    By brewgle in forum MicroStation
    Replies: 3
    Last Post: 04-07-2004, 05:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other forums: Access Forum - Microsoft Office Forum - Exchange Server Forum