Weirdness with SaveNotepad

Posted by Shaun Biggs on Sat 21 Jul 2007 04:08 PM — 2 posts, 13,168 views.

USA #0
This may be just because I'm running MUSHclient in wine, but I'm always getting 0 back from SaveNotepad. I ran /print(SaveNotepad ("challenge", "c:/Program Files/MUSHclient/challenge.txt", 0)) and got a 0, then catted it, rmed it, then saved it again. Still got a 0 returned, but the file was saved correctly. Then I updated the notepad a bit, and ran it again without erasing the file. It was overwritten... So I mucked about with the data again, then saved with /print(SaveNotepad ("challenge", "c:/Program Files/MUSHclient/challenge.txt", 1)) instead, got a 0 returned, and the file was overwritten.

My apologies if this made no sense, or I've gotten quite confused here. I've been up for far too long to make much sense.
Australia Forum Administrator #1
I see what you mean. There are two problems here:

  • The sense of the returned value was inadvertently reversed. Zero is meaning a good save. I will fix that in version 4.14 onwards to conform with the documentation.
  • The "replaceexisting" flag didn't do what I thought it did, and the documentation is therefore wrong. I have amended the online version now, and the fixed help file will ship with version 4.14 onwards:

    http://www.gammon.com.au/scripts/doc.php?function=SaveNotepad