Jump to content

Recommended Posts

Posted

Hi all.

I 'm trying to write a lisp routine for some purposes that it creates a file with the name i specified for it in the path "D:\myname.txt".

this routine is not complete yet and i tested it before completing.

As i run this routine, it create the file and then returns this error:

; error: bad argument type: FILE nil

 

Is there anyone who can tell me what does this error mean?

How i can solve this error?

Posted

Please post an excerpt from your code for debug.

 

Regards,

Posted

Thanks msasu.

I found the reason of producing this error.

I have a "while loop" after creation of the file.

in this loop i have this prompt line:

 
(princ "\n << ...some statements... AND THEN PRESS "ENTER": >> ")

I found that existing of "ENTER" is the reason.

Now i have no problem.

Posted

Should format it like this:

 

(princ "\n << ...some statements... AND THEN PRESS [color=Blue]\[/color]"ENTER[color=Blue]\[/color]": >> ")

 

Regards,

Posted

I 'm So tahnkful Lee Mac and msasu.

Posted

I agree with Lee and msasu. However, you can also use the ascii character.

 

eg.

(princ (strcat "\n << ...some statements... AND THEN PRESS " (chr 34) "ENTER" (chr 34) ": >> "))

 

I keep this for reference:

asciifull.gif

Posted

Thanks Alanjt.

I 'm interested in different ways but similar actions.

Posted
Thanks Alanj.

I 'm interested in different ways but similar actions.

No problem. :)

I would and do do it the way Lee and msasu suggested, but the ascii characters are very useful to know. I refer to this from time to time.

 

You can also find out an ascii character by using the ascii command.

 

eg.

Command: (ascii "3")
51

 

and chr to to in reverse.

eg.

Command: (chr 51)
"3"

Posted

I would try to use your good offer.

Thanks.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...