Jump to content

Exiting a LISP Function; but not the application


Recommended Posts

Posted

I have a VBA program that runs a LISP file, just fine, from "vbarun". However, I am trying to create another LISP file that loads the VBA program.

 

Well, I can get that just fine. The problem is it all works, except when the LISP file called by the VBA code runs into my error trap, which exits the LISP file. The program does not continue, as it would if I ran the program using "vbarun".

 

I believe it is because the exit statement, exits out of LISP, which exits out of my first program. Is there a way around this? Is there a LISP statement that just exits out of a LISP function?

 

In other words, the steps are the following:

 

1. Run LISP_A

2. LISP_A loads LISP_B and loads/runs VBA_A

3. VBA_A calls LISP_B

- If LISP_B runs into an Error an exit statement (in LISP_B) is called and the whole program crashes.

 

Thanks,

Chris

Posted

Hmm... It isn't good way. VBA and AutoLISP programs work asynchronous, each in own namespace.

 

Why is such a bizarre scenario? I am confident that everything can be solved more easily using only one programming environment, LISP or VBA. Of course run VBA with lisp is normal but run lisp with VBA isn't.

Posted

Thanks for the reply.

 

And from your response I may have to ask everyone to load "LISP_B" into their startup suite, which is what I did when I was testing the VBA program.

 

I was just hoping there was another way. :geek:

Posted

may be?

(if
 (vl-catch-all-error-p
   (vl-catch-all-apply
     '(lambda ()
        (exit)
        )
     )
   )
  ...load vba_a...
  )

  • 4 months later...
Posted

Use (vl-exit-with-error "") instead of (exit)

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