help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: About "warning: implicit conversion from matrix to string"


From: Richardson, Anthony
Subject: RE: About "warning: implicit conversion from matrix to string"
Date: Thu, 20 May 2010 08:53:23 -0500


> -----Original Message-----
> From: John W. Eaton [mailto:address@hidden
> Sent: Thursday, May 20, 2010 8:43 AM
> To: Richardson, Anthony
> Cc: Dr.cryo; address@hidden; address@hidden
> Subject: RE: About "warning: implicit conversion from matrix to
string"
> 
> On 20-May-2010, Richardson, Anthony wrote:
> 
> | Alternatively, replace the above line in print.m with:
> |
> |     if(isempty(ghostscript_binary))
> |       have_ghostscript = 0;
> |     else
> |       have_ghostscript = (exist (ghostscript_binary, "file") == 2);
> |     endif
> |
> | to make the warning go away.
> 
> How does ghostscript_binary ever get set to [] instead of ""?

Initially ghostscript_binary is set to "", but a few lines later in the
script
a line similar to this appears (it actually appears in a loop):

ghostscript_binary = file_in_path(EXEC_PATH, ghostscript_binary);

This returns an empty matrix if ghostscript_binary is not in the path.
You could reset ghostscript_binary to "" after the loop if
it is an empty matrix at this point.


> Or, maybe we should make it so that
> 
>   exist ([], ...)
> 
> does the check instead of assuming the first argument is a character
> string?

I'm in favor of this.

Tony



reply via email to

[Prev in Thread] Current Thread [Next in Thread]