Error: bad argument type: FILE nil

Error: bad argument type: FILE nil

Anonymous
Not applicable
7,055 Views
4 Replies
Message 1 of 5

Error: bad argument type: FILE nil

Anonymous
Not applicable

Error: bad argument type: FILE nil
Cannot invoke (command) from *error* without prior call to (*push-error-using-command*).
Converting (command) calls to (command-s) is recommended.firecad error.PNG

0 Likes
7,056 Views
4 Replies
Replies (4)
Message 2 of 5

Ranjit_Singh
Advisor
Advisor

That occurs when the called function results in an error and the error function is calling command. Change the command call to command-s in error function. I would also recommend commenting out the error function and running the routine. This will allow the calling function to break at error and return the actual error message.

If all that is confusing then post your code.

0 Likes
Message 3 of 5

Kent1Cooper
Consultant
Consultant

Those are two different things.  The second part is as @Ranjit_Singh describes.  The first part would be from some function that is expecting to be given a file to work with, but is being given nil instead.  That could be from a variable that does not get set, or one whose name is misspelled where it is given to that function, or something like a (findfile) function that is looking for a file that does not exist, or probably some other reasons.

Kent Cooper, AIA
0 Likes
Message 4 of 5

john.uhden
Mentor
Mentor

Could it be as simple as not setting a symbol to a file pointer, as in (setq fp (open file "w"))?

 

You can't write to a file named by a string, without opening it first.  Nor can you in a read operation.

John F. Uhden

0 Likes
Message 5 of 5

Anonymous
Not applicable

here i am at the end of 2019 with this **** of a message. After 4 hours i found an answer for my problem.

NIL is referring to some stupid image added as xref or inserted.  Removed the image or detach it and the error is gone

0 Likes