On 25 September 2012 15:11, adam aitkenhead <adamaitkenh...@hotmail.com> wrote: > Thanks for the tips, they all sound like a good idea - I'll aim to follow > them for future code. (Yup, I've been trying to keep the code so that it > also works in Matlab where possible.)
I've been changing a bit the input check. The standard we have is to check the value of nargin. Doing this at the start means that you don't have to check if the variable exists later. Another thing I noticed is the many ways it tries to handle invalid filenames. While it looks kinda slick, I'm not sure it's a good idea to have the function doing it, it should be done by the script that calls it. When you give wrong arguments to a function, trying to guess what is right can lead to weird results. Or does matlab also behaves that way (it's not documented at least). My suggestion would be to maybe display the file selection if no argument is given but return an error if the filenames are not valid files. What do you think? Carnë ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev