OpenFileRequester with no selection

Just starting out? Need help? Post your questions and find answers here.
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

OpenFileRequester with no selection

Post by Dude »

Hi, my app uses OpenFileRequester() to allow the user to select a file, or to let them choose no file. However, returning null means the dialog was cancelled, rather than "no file" indicated. That is, if no filename is specified in the "File name" box, then clicking "Open" does nothing. :( How can I differentiate between the two? Or how would you code your own app so that opting to select a file (or no file) can be done? Thanks.
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: OpenFileRequester with no selection

Post by RSBasic »

You can create your own OpenFileRequester window or you can create a loop with a MessageRequester with the information that the user must enter something. Otherwise the program will quit.
Image
Image
Post Reply