Jump to content

Recommended Posts

Posted

Dear all

How to call lisp to another lisp

I want startup lisp abc.lsp execute my main lisp xyz.lsp

& another question startup lisp abc.lsp execute my xyz.lsp internal command : aaa

Posted
[color=red]Subfunction:[/color]

(MySubfunction)

[color=red]Subfunction with Arguments:[/color]

(MySubfunction arg1 arg2 arg3 ... argN)

[color=red]Main function:[/color]

(c:MyFunction)

Posted
[color=red]Subfunction:[/color]

(MySubfunction)

[color=red]Subfunction with Arguments:[/color]

(MySubfunction arg1 arg2 arg3 ... argN)

[color=red]Main function:[/color]

(c:MyFunction)

Dear sir

Thx for reply

it's possible give example

Posted
(defun c:main ( )
 (print (DoMath 3.4)) ;; Call subfunction with arguments
 (c:main2) ;; Call main function
 (princ)
)

(defun DoMath ( x ) (sqrt (+ x 4.0)))

(defun c:main2 ( )
 (alert "Main2 Executed")
 (princ)
)

Posted

1>xyz.lsp>

(defun aaa

(princ)

)

 

(defun main

(princ)

)

(main)

(defun c:aaa2

(aaa)

)

 

 

2>abc.lsp>

(load xyz.lsp)

(aaa2)

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