error: bad argument type: stringp nil

error: bad argument type: stringp nil

Anonymous
Not applicable
1,244 Views
2 Replies
Message 1 of 3

error: bad argument type: stringp nil

Anonymous
Not applicable
Hello
I really need help, I wrote this lisp 18 years ago, I try to make it work on windows 10 and autocad 2019, I have an error on the command "regenkey" and "mobicadcod", if you can help me, thank you in advance. Atached you have the lsp file.
0 Likes
Accepted solutions (1)
1,245 Views
2 Replies
Replies (2)
Message 2 of 3

cadffm
Consultant
Consultant
Accepted solution

Hi,

 

STRINGP is the feedback of an internal predicate function.

For example: SUBSTR need a STRING as first argument,

stringp checks the first argument for "Is it a string?" string predicate / STRINGP

 

Error STRINGP means: Need a string, but it wasn't a string.

 

Where is the problem? Your old RegKeys doesn't match  the RegKeys of your current windows version.

You have to find where the information is stored in this windows version.

 

(defun codblocare# ()
(setq keya1 ( vl-registry-read "HKEY_local_machine\\SOFTWARE\\microsoft\\WINDOWS\\currentversion" "productkey"))

keya1 is NIL, because there is no vl-registry-read "HKEY_local_machine\\SOFTWARE\\microsoft\\WINDOWS\\currentversion(\\productkey), right?
...
(setq ccd1 (substr keya1 2 1 ))

SUBSTR want a String, but keya1 is nil (and nil is nothing), the error: bad argument type: stringp nil appears

 

 

Sebastian

Message 3 of 3

Anonymous
Not applicable
thanks for the reply, that's right, I managed to solve it
0 Likes