Page 1 of 1

Can FileRequest return a new name?

Posted: Wed Jan 18, 2023 10:43 am
by Bugala
What I tried to do was:

Code: Select all

filename$ = FileRequest("Choose a Username/Save File, or create a new one by giving a new name", {path = CurrentDirectory.."/users", file="newname"})
By other words, idea being that user can either choose existing file, or create a new one by giving non-existing file name.

However, seems Hollywood automatically demands you to either choose real existing file, or cancel.

Is there any way to do it this way that I am trying to do this?

If not, then as a request to add one of the modes in such way that it lets you pick a name that doesnt exist as a file.

Idea being that after returning from FileRequest, you can use Exists() to check if that file is an existing one, or if user gave a non existing file name, and then continue accordingly.

Re: Can FileRequest return a new name?

Posted: Wed Jan 18, 2023 2:23 pm
by jPV
Bugala wrote: Wed Jan 18, 2023 10:43 am However, seems Hollywood automatically demands you to either choose real existing file, or cancel.
This is not what I've experienced, for me it's been always possible to select a new non-existing file when saving new files. At least on Amiga compatible systems, but maybe there's a difference on other systems? Have you tried the #REQ_SAVEMODE mode if that'd affect?

Re: Can FileRequest return a new name?

Posted: Wed Jan 18, 2023 6:18 pm
by Bugala
Thanks a lot! This one seems to fix the problem.

@Andreas

Maybe change the text a bit on documentation, I did read text about those different modes on FileRequest() but didnt understand what that save mode with #REQ_SAVEMODE meant.

Also, might be good to add link to some description to some more commands that are useful with FileRequest()-command, like GetCurrentDirectory() is very useful when wanting to use programs own path as starting point, I however was aware that there is somewhere a command like this and was able to dig it out, but otherwise there is not even a hint about these commands in FileRequest() documentation.