Is the "File Must Exist" option broken

If reporting a bug with the Zeus IDE please post the details here. Please do not post questions here.
Post Reply
sfeldner
Posts: 10
Joined: Wed Sep 24, 2008 3:44 pm

Is the "File Must Exist" option broken

Post by sfeldner » Mon Aug 26, 2013 8:11 pm

I'm using 3.97o and if I have the Editor Option> File to Open Must Exist unticked, I cannot "create" a new file from the "Open File" dialog. I want to open/create a new document with UTF8 encoding. Am I doing something wrong.

And a question along those lines... How can you change the encoding of a file that you have open in Zeus. If you go to Options> Properties and make the change, it changes the definition for that whole file type. Also, I thought that I could do a "Save As" of the open document and specify a different encoding. But, when I do a File >Save As> Choose a different encoding > Save I get "File already exists..." which I would expect and to which I answer Yes. The another popup shows up with something like "The save requested can't be done because the file being saved is already open in the editor".

In the end, I can't figure out an easy way to change encoding???

jussij
Site Admin
Posts: 2488
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Mon Aug 26, 2013 11:47 pm

I'm using 3.97o and if I have the Editor Option> File to Open Must Exist unticked

The file must exit option was added to stop the creation of unwanted files.

If you run Zeus from the command line and specify a file that does not exist, that file may/may not be created based on this flag.
I cannot "create" a new file from the "Open File" dialog.

That is standard Windows File Open dialog behaviour.

You need to instead use the file_select_dialog macro function.

There is an example of how to use this in the zScript\file_open.lua macro.
How can you change the encoding of a file that you have open in Zeus.

You can set it based on file extension.

You can also use the set_file_type(type) macro function to set the type of the active document.

The type value can be one of the following values:

Code: Select all

  // ASCII   = 0,
  // UTF8    = 1
  // UNICODE = 2
  // BINARY  = 3
"The save requested can't be done because the file being saved is already open in the editor".

You might have found a bug :?

Zeus by design only allows the file to be opened once inside the editor.

That message is there for the case where you have files a.txt and b.txt open in Zeus and you then use the Save As to save b.txt to a.txt,thus breaking the above rule.

Cheers Jussi

Post Reply
kuchnie warszawa opinie

Who is online

Users browsing this forum: No registered users and 1 guest