Can FileRequest return a new name?

Discuss any general programming issues here
Post Reply
Bugala
Posts: 1078
Joined: Sun Feb 14, 2010 7:11 pm

Can FileRequest return a new name?

Post 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.
User avatar
jPV
Posts: 499
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Can FileRequest return a new name?

Post 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?
Bugala
Posts: 1078
Joined: Sun Feb 14, 2010 7:11 pm

Re: Can FileRequest return a new name?

Post 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.
Post Reply