Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Setenv, getenv How to DELENV??

2 REPLIES 2
Reply
Message 1 of 3
SAPER59
1291 Views, 2 Replies

Setenv, getenv How to DELENV??

I need to erase a variable seted to the environment with SETENV, but not seting it to a value like "".

I need that when it is reading with GETENV, return a NIL value like when it wasn't exist after the first seting

 

Thanks in advance

2 REPLIES 2
Message 2 of 3
patrick_35
in reply to: SAPER59

Hi

For example

(defun delenv(env / cle)
  (setq cle (strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "\\FixedProfile\\General"))
  (if (vl-registry-read cle env)
    (vl-registry-delete cle env)
  )
)

 
@+

Message 3 of 3
scot-65
in reply to: SAPER59

If not mistaken, SETENV and GETENV accesses the registry keys established by the software.

By deleting these keys you are asking for trouble.

 

If you established keys using VL-REGISTRY-WRITE, and you SETVAR/SETENV using your

VL-REGISTRY-READ, deleting these keys will only corrupt your program, and not the software.

 

Be careful.

 

???


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost