Michel
(setq fp (open "c:\\abc.txt", "r"))
(setq txt (read-line fp))
The proper coding to avoid this would be:
(setq fp (open "c:\\abc.txt", "r"))
(if fp
(setq txt (read-line fp))
;else
(prompt "\nCannot open file for reading.")
)
--
Alex Januszkiewicz -> al...@intelcad.com
President, Intelcad Systems -> http://www.intelcad.com
911 DWG Recovery Services
ObjectARX, WHIPTK (DWF), OpenDWG and MDL Development
--
Randall D Foster <rdf...@fgi.net> wrote in message
news:7mkob7$gc...@adesknews2.autodesk.com...
--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.t...@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
The "streamp" message is generally one that you'll see
if you call a function that requires an open file as one
of its paramters, but is getting something else.
Your code is bugged, but we can't tell you where the
problem is without seeing the code. You'll need to
step through the code and find out where the error
is, to find out what's wrong.
If it is causing a 'null function' error in R14, then
it is not being loaded.
Randall D Foster wrote:
>
> Michel
>
> Below is the "Remove" function, as I noted in the previous post, It worked
> in A2K but not in R14, at least on my machine. So the 1st issue is why?
>
> ;;;REMOVE -Removes an item from a list (double elements allowed)
> (defun remove (expr lst) ;(c) by Serge Volkov
> (apply 'append (subst nil (list expr) (mapcar 'list lst)))
> );_end of defun ;
>
> And now my real problem is "error: bad argument type: streamp nil" ; I can
> only guess at what this MSG represents. The program code for the application
> was in the "final" stages of editing, and a real mess. I had a point sorting
> routine running well and was hooking up both the user input routines and the
> program output routines, when this morning Acad won't even refresh the
> edited version of the Lisp program, load fails with above MSG. and reverts
> to previous program.
> I got the same MSG when Acad loaded the CHText in starting with a blank
> DWG. in A2K this morning.
>
> These issues are probably not be related. But the fact that CHText failed
> with a blank dwg seems to point to a system setting. I have installed A2k
> over the top of R14 directory. Then, because of Calcomp Techjet 5524
> plotting problems, I re-installed R14 on the D: drive. This didn't seem to
> cause any problems for on my WinNT SP4 system Micron Pro2 200 Dual.
> I could post full listing if you think it would help.
> Regards,
> Randy
>
> Michel Trottier wrote in message <378DE53C...@isi-mtl.com>...
> >Would be great to see those codes....we could be able to help
> >
> >Michel
> >
... (1.54006 2.16506 2.79006 3.41506 4.04006) error: null function
(REMOVE YMAX YROWS)
(SETQ YROWS (REMOVE YMAX YROWS))
(REPEAT NROWS (SETQ YMAX (APPLY (QUOTE MAX) YROWS)) ...
I know the problem is not in the routine itself ...
I will plat with it a bit and see if I find a difference in level of
calling and parameters. I agree it should work in both versions.
Regards
Randy
Tony Tanzillo wrote in message <378E0D9B...@worldnet.att.net>...
>The (remove) function you show works in all releases of
>AutoCAD.
>
>If it is causing a 'null function' error in R14, then
>it is not being loaded.
>
snip...
> CHText failed< snip
The error MSG was being pumped in on the same line as the CHText load ...
it actually wasn't failing ... the auto-load of the menu bar fuction for the
sort routine was failing
>> with a blank dwg seems to point to a system setting. I have installed A2k
>> over the top of R14 directory. Then, because of Calcomp Techjet 5524
>> plotting problems, I re-installed R14 on the D: drive. This didn't seem
to
>> cause any problems for on my WinNT SP4 system Micron Pro2 200 Dual.
>> I could post full listing if you think it would help.
>> Regards,
>> Randy
>>
>> Michel Trottier wrote in message <378DE53C...@isi-mtl.com>...
>> >Would be great to see those codes....we could be able to help
>> >
>> >Michel
>> >
>> >Randall D Foster wrote:
>> >
>> >> My Acad seems to be unraveling. Yesterday I posted a problem with
>> "Remove"
>> >> function : it would run ok as a subr in A2K but returned null function
in
>> >> R14. This morning when I boot up A2K, my autoloaded Lisp functions are
>> >> rejected at Startup with a MSG. error: bad argument type: streamp
nil. I
>> >> get the same "streamp" MSG. with some menu bar loaded Lisp functions.
>> Didn't
>> >> find info. on streamp in Acad or Vlisp help? Help!
>> >> Randy
>> >
>
A stream is a stream.
A horse is a horse.
A streamp is, well .... a stream predicate function.
--
Alex Januszkiewicz -> al...@intelcad.com
President, Intelcad Systems -> http://www.intelcad.com
911 DWG Recovery Services
ObjectARX, WHIPTK (DWF), OpenDWG and MDL Development
--
Tony Tanzillo <tony.t...@worldnet.att.net> wrote in message
news:378E05BF...@worldnet.att.net...
> No - "streamp" does not mean "stream pointer", it's
> a predicate function that returns T if its parameter
> is a stream, or nil otherwise (predicate functions
> end with "p").
>
> Alex Januszkiewicz wrote:
> >
> > I'm not using Visual Lisp, but if streamp is what I think it is (stream
> > pointer), then check for operations of reading, writing from the file.
> > For example, if file ABC.TXT was not existing, situation like this could
> > cause the error:
> >
> > (setq fp (open "c:\\abc.txt", "r"))
> > (setq txt (read-line fp))
> >
> > The proper coding to avoid this would be:
> >
> > (setq fp (open "c:\\abc.txt", "r"))
> > (if fp
> > (setq txt (read-line fp))
> > ;else
> > (prompt "\nCannot open file for reading.")
> > )
> >
> > --
> > Alex Januszkiewicz -> al...@intelcad.com
> > President, Intelcad Systems -> http://www.intelcad.com
> > 911 DWG Recovery Services
> > ObjectARX, WHIPTK (DWF), OpenDWG and MDL Development
> >
> > --
> >
> > Randall D Foster <rdf...@fgi.net> wrote in message
> > news:7mkob7$gc...@adesknews2.autodesk.com...
I couldn't care less whether you do or do not care about
what the exact meaning of "streamp" is, I'm am simply
pointing out that your presumption that 'streamp' means
'stream pointer' is not correct.
I don't care what you're using. I was simply stating that
'streamp' does not mean what you thought it did, and since
I would not bother to respond to your comment if it were
for your benefit only, consider my response to be for
the benefit of others looking in, who may be mislead by
your inaccurate presumption, regardless of whether you
care about/like it, or not.
--
Reinaldo Togores Fernández
Profesor Asociado
Dpto. Ing. Geográfica
y Técnicas de Expresión Gráfica
Universidad de Cantabria
http://start.at.autolisp/
--
have a look into any lisp specs if it's not self-explanatory.
CLHS (the common lisp hyperspec) and CLtL2 (common lisp the language) is
even on-line. urls are at my lisp page.
all these error messages are failing type predicates, mostly generated
automatically.
a cons is a not-empty list,
a stream is a file or file-buffer (we have no pipes in vlisp),
a string is a string
of course they should be documented somehow.
--
Reini