TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Kate M on October 18, 2007, 03:16:26 PM

Title: Simple question (indefinite points)
Post by: Kate M on October 18, 2007, 03:16:26 PM
I'm trying to help somebody on the adesk forums, and got thrown by what I assume is an easy problem

Code: [Select]
;;Revcloud from spline
(defun C:RS ()
  (command "_.spline")
  (command "_.revcloud" "o" "l" "n")
  (princ)
)

How do I let the spline command finish before moving on to the revcloud, assuming I don't know how many points there will be in the spline?

(I was all proud of myself for writing it out in lisp, then realized it wasn't any different from the same steps in a macro...<sigh>... :oops:)
Title: Re: Simple question (indefinite points)
Post by: T.Willey on October 18, 2007, 03:24:06 PM
Code: [Select]
;;Revcloud from spline
(defun C:RS ()
  (command "_.spline")
  (while (> (getvar "CmdActive") 0)
    (command pause)
  )
  (command "_.revcloud" "o" "l" "n")
  (princ)
)
Also since you are making it available for international use (the underscore before the commands) why not carry that throughout the command calls.
Code: [Select]
;;Revcloud from spline
(defun C:RS ()
  (command "_.spline")
  (while (> (getvar "CmdActive") 0)
    (command pause)
  )
  (command "_.revcloud" "_o" "_l" "_n")
  (princ)
)
Title: Re: Simple question (indefinite points)
Post by: Kate M on October 18, 2007, 03:26:37 PM
Sweet. This place rocks. :-D
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 04:07:59 PM
haha, i found your post!

thanks so much for this easy fix!!
Title: Re: Simple question (indefinite points)
Post by: Kate M on October 18, 2007, 04:09:23 PM
I thought you said it didn't work?
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 04:10:24 PM
go read my *edited* reply in autodesk forums....
Title: Re: Simple question (indefinite points)
Post by: Kate M on October 18, 2007, 04:12:04 PM
Don't see any edits from the newsreader side...whatever, glad it works. :-)

Welcome to the swamp!
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 04:14:26 PM
yeah, sorry...

definite props to you Kate for finding exactly what I wanted!

oh, and kudos for the guy who also thought of exactly the same thing I did and wrote something about it!
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 04:24:18 PM
okay so I'm really happy that this works, but can I get a little picky too?

awesome!  :-D

How would I also have it go straight to the CLOUD layer, and automatically turn ortho and osnap OFF, then return to them being on if they were in the first place?

FYI: I'm gonna be also be making a button or right-click function out of this, any qualms?
Title: Re: Simple question (indefinite points)
Post by: M-dub on October 18, 2007, 04:29:11 PM
FWIW, I have this macro button for adding text... Don't use it too much anymore, but I still have it.

^C^C(setq oldlayer (getvar "clayer"));-LA;S;TEXT;;DText;J;ML;\;\(setvar "clayer" oldlayer);


I'm not sure if I understand completely what you're trying to do, though.
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 04:32:33 PM
FWIW, I have this macro button for adding text... Don't use it too much anymore, but I still have it.

^C^C(setq oldlayer (getvar "clayer"));-LA;S;TEXT;;DText;J;ML;\;\(setvar "clayer" oldlayer);


I'm not sure if I understand completely what you're trying to do, though.

so are you saying you have a qualm with me using the revspline function as a button?

I don't understand your reply sir, unless you posted in the wrong topic, then I understand completely.  :ugly:
Title: Re: Simple question (indefinite points)
Post by: M-dub on October 18, 2007, 04:35:20 PM
Just thought I'd throw it in there in response to this...

How would I also have it go straight to the CLOUD layer, and automatically turn ortho and osnap OFF, then return to them being on if they were in the first place?

I can come back to it tomorrow, but my wife just beckoned... I've gotta jet!
Title: Re: Simple question (indefinite points)
Post by: Kate M on October 18, 2007, 04:37:23 PM
Quick & dirty...with the caveats that layer CLOUD must exist, and I left out the ortho part. Mainly because I like polar so much better, and I couldn't figure out how to turn it off with a variable.

Code: [Select]
;;Revcloud from spline
(defun C:RS (/ user_layer user_os)
  (setvar user_layer (getvar "clayer"))
    (setvar "clayer" "CLOUD")
  (setvar user_os (getvar "osmode"))
    (setvar "osmode" 0)
  (command "_.spline")
  (while (> (getvar "CmdActive") 0)
    (command pause)
  )
  (command "_.revcloud" "o" "l" "n")
  (setvar "clayer" user_layer)
  (setvar "osmode" user_os)
  (princ)
)

I think M-dub is trying to teach you how to fish. (See the "About this Forum" sticky.) :wink:

However, I am learning to fish myself, so this is practice for me. We'll make you write the next one yourself. :-D
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 04:51:20 PM
CLOUD layer would definitely exist, as that our company's standard C/S/A layers are dumped into every dwg we create.

this is great y'all.

I love fishing! Only I forgot to bait the hook. :|
Title: Re: Simple question (indefinite points)
Post by: T.Willey on October 18, 2007, 04:57:07 PM
Kate,

Ortho = OrthoMode system variable.
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 04:59:19 PM
Quick & dirty...with the caveats that layer CLOUD must exist, and I left out the ortho part. Mainly because I like polar so much better, and I couldn't figure out how to turn it off with a variable.

Code: [Select]
;;Revcloud from spline
(defun C:RS (/ user_layer user_os)
  (setvar user_layer (getvar "clayer"))
    (setvar "clayer" "CLOUD")
  (setvar user_os (getvar "osmode"))
    (setvar "osmode" 0)
  (command "_.spline")
  (while (> (getvar "CmdActive") 0)
    (command pause)
  )
  (command "_.revcloud" "o" "l" "n")
  (setvar "clayer" user_layer)
  (setvar "osmode" user_os)
  (princ)
)

I think M-dub is trying to teach you how to fish. (See the "About this Forum" sticky.) :wink:

However, I am learning to fish myself, so this is practice for me. We'll make you write the next one yourself. :-D

Command: rs
; error: bad argument type: (or stringp symbolp): nil


I have no idea what this means... but I could take a stab at it.

it's a PICNIC = problem in chair, not in computer  :-o
Title: Re: Simple question (indefinite points)
Post by: LE on October 18, 2007, 05:01:55 PM
make sure the layer exist, first.... before using setvar "clayer"
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 05:02:47 PM
it does exist.
Title: Re: Simple question (indefinite points)
Post by: JohnK on October 18, 2007, 05:06:11 PM
T.Willey,

Funny you should use a `>' type of check; have you every had any problems with that? The reason I ask is because ive always just checked for a regular command, something like:
Code: [Select]
(eq (logand (getvar "CMDACTIVE") 1) 1)
have you every used this type of process in a transparent command before? Now you have me thinking about this? I think I might have to run an experiment or two.

Kate,
You might want to think about accounting for an error or two.
QUICK HINTS:
1. Have a look around for my osnap `toggle'  procedure.
2. Be carefull with that (setvar 'clayer ...process.
Title: Re: Simple question (indefinite points)
Post by: LE on October 18, 2007, 05:06:46 PM
:)

Rename:

(setvar user_layer (getvar "clayer"))

To:

(setq user_layer (getvar "clayer"))


and...

(setvar user_os (getvar "osmode"))

to

(setq user_os (getvar "osmode"))
Title: Re: Simple question (indefinite points)
Post by: T.Willey on October 18, 2007, 05:10:51 PM
T.Willey,

Funny you should use a `>' type of check; have you every had any problems with that? The reason I ask is because ive always just checked for a regular command, something like:
Code: [Select]
(eq (logand (getvar "CMDACTIVE") 1) 1)
have you every used this type of process in a transparent command before? Now you have me thinking about this? I think I might have to run an experiment or two.

Kate,
You might want to think about accounting for an error or two.
QUICK HINTS:
1. Have a look around for my osnap `toggle'  procedure.
2. Be carefull with that (setvar 'clayer ...process.

I have seen other code posted like that John, but my math isn't what is used to be, and I understand the '>' way better.   :-)  As much as I can recall, I have never had a problem with using it this way.  I can check my personal code and see if I have any in there like that, and try and remember if that piece of code as ever error'ed from me.
Title: Re: Simple question (indefinite points)
Post by: JohnK on October 18, 2007, 05:18:25 PM
I have seen other code posted like that John, but my math isn't what is used to be, and I understand the '>' way better.   :-)  As much as I can recall, I have never had a problem with using it this way.  I can check my personal code and see if I have any in there like that, and try and remember if that piece of code as ever error'ed from me.

*lol* cool. It was just that your test got me thinking about its use in a transparent command (vlax-add-cmd).
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 05:26:02 PM
great. now my acad won't open!

BTW- I put the lsp in the startup, so that tells me I have to change something. Just before, I did this:

Replaced
(setvar user_layer (getvar "clayer"))

to:

(setq user_layer (getvar "clayer"))


and...

(setvar user_os (getvar "osmode"))

to

(setq user_os (getvar "osmode"))

So now how do I get my ACAD back up and running?
Title: Re: Simple question (indefinite points)
Post by: Josh Nieman on October 18, 2007, 05:30:03 PM
Whatever you did.... UNdo it.

I highly recommend that whenever you go and edit a file of such importance as the acad startup routines, that you create a backup.  Just copy the original (after you fix it, of course) and rename it to acad.lsp.bak or something like that... I usually keep the original name and file extension, and just add a .bak to the end...

This way if you really bork something up and don't know why... you can just recopy the backup over the borked file.
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 05:36:03 PM
well, I did save the orginal *working* lisp routine. So I wrote over the corrupted one, and still nothing. My ACAD will not open now. I could get into a lot of trouble with my office manager if she finds out what I did!

Please help, I promise I won't bork anything up again!!
Title: Re: Simple question (indefinite points)
Post by: Josh Nieman on October 18, 2007, 05:40:20 PM
What's the last thing you did before it stopped working?
Title: Re: Simple question (indefinite points)
Post by: JohnK on October 18, 2007, 05:40:32 PM
What do you mean your acad wont start?

BTW, did you edit this file in MS Word?
Title: Re: Simple question (indefinite points)
Post by: T.Willey on October 18, 2007, 05:40:53 PM
Nothing in the routine should have ruined your Acad.  This is just a simple routine to speedup some button pushing.

Standard IT response.... Did you try rebooting?? ... Crazy thing is.. it works most of the time.
Title: Re: Simple question (indefinite points)
Post by: Josh Nieman on October 18, 2007, 05:41:56 PM
Also, specifically what 'doesnt work' ?

Does nothing happen when you double click the startup icon, or select it from the start menu or whatever method you use?

Does the application open and report an error?  If so, what does the error say, specifically?
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 05:47:16 PM
Okay, just before it quit opening, I changed the strings like LE suggested. And so, since the lisp routine was already in startup suite, I simply restarted ACAD (clicked icon, AND clicked on a dwg). Or tried to at least...

It simply stops at regen... and hangs. I eventually have to hit Ctrl+Alt+Delete to end application, then window pops up stating that AutoCad stopped responding.

I'll be back shortly, gonna reboot computer.
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 05:48:35 PM
What do you mean your acad wont start?

BTW, did you edit this file in MS Word?

no, I always use notepad....
Title: Re: Simple question (indefinite points)
Post by: LE on October 18, 2007, 05:49:38 PM
great. now my acad won't open!

BTW- I put the lsp in the startup, so that tells me I have to change something. Just before, I did this:

Replaced
(setvar user_layer (getvar "clayer"))

to:

(setq user_layer (getvar "clayer"))


and...

(setvar user_os (getvar "osmode"))

to

(setq user_os (getvar "osmode"))

So now how do I get my ACAD back up and running?

No idea, what you end up doing ?

Remove the lisp from there...  (what it is for you the startup?)

So, you double-click on the ACAD.EXE and does not open it?

Title: Re: Simple question (indefinite points)
Post by: JohnK on October 18, 2007, 05:53:21 PM
Well the items LE suggested would have NO affect on anything like that, but just to be safe, delete the procedure anyways.

After that, start up acad and change the profile to something else and open a drawing.
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 05:57:20 PM
Nothing in the routine should have ruined your Acad.  This is just a simple routine to speedup some button pushing.

Standard IT response.... Did you try rebooting?? ... Crazy thing is.. it works most of the time.

hahaha... worked. weird.

In my office: standard IT response - where's the IT guy when you need him?

in other words, we don't have an IT. Just an office manager that knows a little bit about networking, that's all.

thanks for the suggestion, I've never really encountered a situation where all I had to do was reboot.
Title: Re: Simple question (indefinite points)
Post by: LE on October 18, 2007, 05:58:10 PM
and.... can you post/or/upload your code (the file) here.... maybe is something in there.
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 06:00:47 PM
okay so back to bizness....

I want the routine to:

set layer to CLOUD

turn off ortho

and turn off osnap

finish the routine, then set ortho and osnap back to what they were, whether on or off.
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 06:02:12 PM
here's what I got so far:

Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 06:03:53 PM
and.... can you post/or/upload your code (the file) here.... maybe is something in there.

I think it was a gliche or something... our server has been acting up today (it's stormy weather here today).
Title: Re: Simple question (indefinite points)
Post by: LE on October 18, 2007, 06:11:18 PM
and.... can you post/or/upload your code (the file) here.... maybe is something in there.

I think it was a gliche or something... our server has been acting up today (it's stormy weather here today).

Must, be something like that... that routine is a very simple one...
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 06:22:43 PM
so what's the code for turning ortho off?

Code: [Select]
(setq user_ortho (getvar "orthomode"))
  (setvar "orthomode" 0)
???

Or am I not understanding something right?
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 06:26:38 PM
will this work?

Code: [Select]
;;Revcloud from spline
(defun C:RS (/ user_layer user_os user_ortho)
  (setq user_layer (getvar "clayer"))
    (setvar "clayer" "CLOUD")
  (setq user_os (getvar "osmode"))
    (setvar "osmode" 0)
  (setq user_ortho (getvar "orthomode"))
    (setvar "orthomode" 0)
  (command "_.spline")
  (while (> (getvar "CmdActive") 0)
    (command pause)
  )
  (command "_.revcloud" "o" "l" "n")
  (setvar "clayer" user_layer)
  (setvar "osmode" user_os)
  (setvar "orthomode" user_ortho)
  (princ)
)
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 06:31:47 PM
will this work?

Code: [Select]
;;Revcloud from spline
(defun C:RS (/ user_layer user_os user_ortho)
  (setq user_layer (getvar "clayer"))
    (setvar "clayer" "CLOUD")
  (setq user_os (getvar "osmode"))
    (setvar "osmode" 0)
  (setq user_ortho (getvar "orthomode"))
    (setvar "orthomode" 0)
  (command "_.spline")
  (while (> (getvar "CmdActive") 0)
    (command pause)
  )
  (command "_.revcloud" "o" "l" "n")
  (setvar "clayer" user_layer)
  (setvar "osmode" user_os)
  (setvar "orthomode" user_ortho)
  (princ)
)

OMG! It did work!!

I CAN FISH! YAY!!
Title: Re: Simple question (indefinite points)
Post by: T.Willey on October 18, 2007, 06:35:51 PM
You even added your new variable to the local variable list, nice!  Soon you will be giving others advice on how to fix their routines.
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 06:39:32 PM
well, I did learn somethin afterall...

lol.

awesome! Thanks so much for the help y'all! Especially Kate M.

I love this forum!
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 18, 2007, 06:58:50 PM
You even added your new variable to the local variable list, nice!  Soon you will be giving others advice on how to fix their routines.

That was actually a guess. Honestly.

I do know a little about programming. Only robotics programming though, so I do understand how to look at the code (or language) and eventually figure it out. Just I don't know anything about VLisp, VBA, or AutoLISP.

But today was a start....
Title: Re: Simple question (indefinite points)
Post by: T.Willey on October 18, 2007, 07:05:38 PM
Once you start, you won't want to stop.  You will see all these little things that you do, and could be automated to save a couple of keystrokes per usage, and you will automate it.  Happened to us all!  And each one of us had to start somewhere.

Welcome to the Swamp Robert!
Title: Re: Simple question (indefinite points)
Post by: JohnK on October 18, 2007, 10:01:15 PM
so what's the code for turning ortho off?

Code: [Select]
(setq user_ortho (getvar "orthomode"))
  (setvar "orthomode" 0)
???

Or am I not understanding something right?

Try this on for size. There are several variations of this but this one will serve you good for now.

[ http://www.theswamp.org/index.php?topic=51.0#top ]
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 24, 2008, 09:10:08 AM
I hate rehashing an OLD thread... but this is where I got started in the swamp... thanks to Kate  :wink:

but, I have another question about this lisp routine.

Often when I use it, I'm in the middle of the routine and if I find that i've messed up the spline, I hit ESC - all my osnap settings reset - grrrr!

how do I write an error function, to the affect that I can make sure my osnap settings never reset. dang I hate that!

Title: Re: Simple question (indefinite points)
Post by: hmspe on October 24, 2008, 09:50:52 AM
I'd suggest doing a search here for "error handler".  There's lots of information.  The first thread returned (started by alanjt) should point you in the right direction.  CAB's routine in post #2 would do what you want.  You'd need to change variable names -- you use 'user_os' while CAB has used 'useros'.  You'd also want to reset clayer and orthomode.  CAB's routine resets cmdecho, which you don't have in your routine.
 
Martin
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 24, 2008, 09:53:26 AM
thanks for the reply.

i'll go looky...
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 24, 2008, 10:05:00 AM
okay... plz help a lispidiot...

do I paste this code just anywhere within my revspline.lsp routine using notepad like this...

Code: [Select]
(defun C:RS (/ user_layer user_os user_ortho)
  (setq user_layer (getvar "clayer"))
    (setvar "clayer" "Dimensions")
  (setq user_os (getvar "osmode"))
    (setvar "osmode" 0)
  (setq user_ortho (getvar "orthomode"))
    (setvar "orthomode" 0)
  (command "_.spline")
  (while (> (getvar "CmdActive") 0)
    (command pause)
  )
  (command "_.revcloud" "o" "l" "n")
  (setvar "clayer" user_layer)
  (setvar "osmode" user_os)
  (setvar "orthomode" user_ortho)
  (princ)
)
  (defun *error* (msg)
    (if (not
          (member msg  '("console break" "Function cancelled" "quit / exit abort" "")))
       (princ (strcat "\nError: " msg))
    ) ; if
    (and user_layer (setvar "clayer" user_layer))
    (and user_os (setvar "osmode" user_os))
    (and user_ortho (setvar "orthomode" user_ortho))
    (princ)
  ) ; end error function

or what?
Title: Re: Simple question (indefinite points)
Post by: Alan Cullen on October 24, 2008, 10:13:57 AM
Just my two bobs worth....but place your error handler above the main code...I will continue to look at your code and get back to you.
Title: Re: Simple question (indefinite points)
Post by: Alan Cullen on October 24, 2008, 10:19:43 AM
Just a minor thought........but why are you trying to capture variables that are not being changed in the lisp....

Everything seems to hinge around this line of code.......
  (command "_.revcloud" "o" "l" "n")

I haven't tested it, so I can't really say, just seems odd. What are you trying to do?
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 24, 2008, 10:33:49 AM
when i draw the spline I don't want to have to manually turn off ortho, osnaps, and change the layer.

i want to make sure ortho is automatically turned off, well that's self-explanatory - it's supposed to be a spline. I want osnaps turned off because I'm working around alot of details and can't stand to snap to things i don't want to snap to. I like for what I do to be fully automated.

Like when I right click, on pick 'Linear Dimension' (custom menu) it automatically puts it on Dimensions layer... get it? same thing when I click 'Dynamic Text' - automatically goes to Text layer, and so on...

And after the lisp routine has finished, and has made the spline into a revcloud, I want to be sure all my snap settings revert back to where they where before I invoked the command. Because acad's stupid .revcloud lisp resets all osnap settings!
Title: Re: Simple question (indefinite points)
Post by: ronjonp on October 24, 2008, 10:42:03 AM
Do a search for CAB's PL2CLOUD.
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 24, 2008, 11:18:53 AM
Do a search for CAB's PL2CLOUD.

that doesn't help me.

I already have a lisp that does *mostly* what I need it to do... I just wanted to make it better with an error function.

besides, you can already make a revcloud out of an already existing polyline, by simply clicking REVCLOUD, right click - or from cmd line, choose Object, then pick the pline.

But I liked better the idea of freehanding a spline into a shape around all my revisions without the "boxy" look. Plus, if I need to make rev's to the rev... I can simply right click on the cloud, turn it back into a spline, edit it however I want, then turn it back into a cloud.
Title: Re: Simple question (indefinite points)
Post by: T.Willey on October 24, 2008, 11:23:49 AM
Simple example

Code: [Select]
(defun c:Test (/ oOs)

  (defun *error* (msg)
   
Man work gets in the way again.... see Alan posted something before I could get back and finish this..... :cry:
Title: Re: Simple question (indefinite points)
Post by: CAB on October 24, 2008, 11:30:10 AM
Or what. 8-)
Code: [Select]
(defun C:RS (/ *error* user_layer user_os user_ortho)

  ;;  always localize this routine!!!!!
  (defun *error* (msg)
    (if (not
          (member msg  '("console break" "Function cancelled" "quit / exit abort" "" nil)))
       (princ (strcat "\nError: " msg))
    )
    (and user_layer (setvar "clayer" user_layer))
    (and user_os (setvar "osmode" user_os))
    (and user_ortho (setvar "orthomode" user_ortho))
    (princ)
  ) ; end error function
 
  (setq user_layer (getvar "clayer"))
    (setvar "clayer" "Dimensions")
  (setq user_os (getvar "osmode"))
    (setvar "osmode" 0)
  (setq user_ortho (getvar "orthomode"))
    (setvar "orthomode" 0)
  (command "_.spline")
  (while (> (getvar "CmdActive") 0)
    (command pause)
  )
  (command "_.revcloud" "o" "l" "n")
  (*error* "")
  (princ)
)
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 24, 2008, 11:40:29 AM
AWESOME!!

 :love:
Title: Re: Simple question (indefinite points)
Post by: CAB on October 24, 2008, 03:57:27 PM
Glad I could be of service.  :-)
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 24, 2008, 05:56:02 PM
...and exactly what do you mean by "always localize this routine"?

I can't necessarily run this routine from my lap  :-)

lol. all my routines are in the support folder...
Title: Re: Simple question (indefinite points)
Post by: T.Willey on October 24, 2008, 06:02:06 PM
He means to localize the error routine.

(defun c:Main (/ *error*)

(defun *error* (msg)
)

)

Above has the error routine localized.

(defun c:Main ()

(defun *error* (msg)
)

)

Above does Not have the error routine localized.
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 24, 2008, 06:10:31 PM
oh.. heh.





why won't this thread DIE already!? gah!
Title: Re: Simple question (indefinite points)
Post by: ronjonp on October 24, 2008, 11:51:59 PM
oh.. heh.





why won't this thread DIE already!? gah!

CAB was trying to edumacate you and you brought up the question? :-P
Title: Re: Simple question (indefinite points)
Post by: CAB on October 25, 2008, 12:07:11 AM
...and exactly what do you mean by "always localize this routine"?

I can't necessarily run this routine from my lap  :-)

lol. all my routines are in the support folder...
When you don't localize the error function it takes over for the built in lisp error handler and stays that way until you (setq *error* nil) or another error handler which is not localized steps on this one.

So it is good practice to clean up after yourself environmentally speaking.

Although that error handler should not cause any problems many error routines attempt to reset environmental variables with program variables that have been clobbered & therefor you get the dreaded message "An error occurred inside the error handler"

It's midnight so I hope I was clear. ZZZzzzzz....
Title: Re: Simple question (indefinite points)
Post by: Notsober on October 25, 2008, 10:44:07 AM
thanks for the more *detailed* explanation... it was clear.

but I did understand T.Willey's explanation too... so it's all good  8-)