On Mon, 6 Jun 2005, Keith Goodman wrote:
Wow. Dreams do come true.
I'm glad that you like it.
I found a couple of problems.
If "savefile" doesn't exist (e.g., I use your hard-coded path to
your octaverc file, or make one up) savepath crashes. That's because
there is a "if (exist(savefile) == 2)" but not an else.
I fixed that (without an else, just by initializing a variable to
empty).
Also I am unable to pass in a name of a file to save the path to.
That's because in
(iscellstr(varargin)) && (size(varargin{1}) ==
prod(size(varargin{1})))
size varargin{1} is [1 19] for something like "/home/kwg/.octaverc"
which is not equal to prod(size).
I was tired last night. I was trying to test to make sure that the
string was just one row. This is fixed now.
[from other message]
I'd also put the save paths at the end of octaverc instead of at the
beginning. If you save a path and then later delete a directory in
the saved path, addpath will produce an error the next time you start
Octave and exit octaverc before executing the other commands in the
startup file.
I did that, but apparently (perhaps another bug in addpath) addpath
only prints out an error, it doesn't actually error out.
Maybe be double safe (since you're changing someone's octaverc file)
by adding try catch.
I added the try catch, too, but it doesn't really have an effect
(though it does seem to be the correct thing to do).