firavolla Posted June 22, 2010 Share Posted June 22, 2010 Ok guys..I have 4-5 lsp routines in different files, let's say 1.lsp, 2.lsp ..., 5.lsp. Now let's say 'var1' is the name representing a variable not only in 1.lsp, but also in 2.lsp. The difference is that in 1.lsp var1 represents let's say the content inside a dcl edit box (after the user clicks ok on the dialogue) and in 2.lsp it represents the simple result of a sum of two other variables (var1=a+b). The way I loaded my lsp files at startup in Acad is creating the file Acad.lsp inside the main install folder of Acad itself and entering 5 lines (one for each of the lsp files) like (load "1.lsp") and so on. The problem is, when i run Acad and try to run let's say 1.lsp, when the interpreter gets to var1 it breaks. Using !var1 I can see it's nil, although inside the lsp file it is defined something like (setq var1 (atof eb1)) where eb1 is the text in the edit box from the dialogue. If before running 1.lsp i run 2.lsp, 2.lsp is ok, and 1.lsp then does not give me anymore problems. Any ideas? Why is this happening and how can I overcome this problem? Thank you. Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 22, 2010 Share Posted June 22, 2010 Localize your variables and/or subroutines. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.