I broadly agree with Robert's last post.
My 2 pennies worth
(a) I too eschew '?' as the 'request' for a path. It's awkward to type (needs SHIFT key) and, as Robert says, neither normal Windows nor SPFLIte standard, as well as being an invalid character for a filename.
I suggest '\' as an alternative prefix character.
Further alternatives might be
'/' (I see that in Windows CMD.EXE CD comand this is also accepted as meaning 'go to root directory')
'..' (Also accepted by CD command, but means 'one up from current directory' which may therefore be confusing)
'\' is simple to type and a common part of any filename so familiar to users.
Hence, a file-spec of ABC.EXT would mean ABC.EXT in whatever default path applies to this tab
And a file-ppec of
\ABC.EXT would provoke a dialog to select a path.
As for which default to apply, if the current tab contains a file whose origin is known, use that same path as default unless users requests a change (no file-spec or one starting with '\') which provokes a selection pop-up. If the current tab doesn't have a known path (Get_FilePath in macro-speak), it's an automatic path selection pop-up)
(c) CREATE/REPLACE command
We three (at least) seem quite comfortable that CREATE (and REPLACE) should write out every line by default, unless the user also specifies a line-control-range.
In good-ol'-IbmSPF, if memory serves, the user either had to specify a proper file-spec with the command, or was presented with a panel on which to do so.
Thus if no file-spec is entered with the command, proceed as described in (a) above. Hence I don't see a need for an "ASK option".
If you really want an ASK argument on the command, you may want to consider a OPTIONS - GENERAL entry so users can specify whether they want ASK as default or not.
I'd also prefer a different solution to a 'Shall-I / Shan't-I Replace' pop-up if the selected file-spec already exists.
I suggest that maybe an additional operand 'REPLACE | REP' on the command syntax can kill several birds with one stone.
- The user can specify this from the outset to simply replace (overwrite) the file in case it exists.
- If REP isn't specified and file-spec exists, could you terminate the command with a non-zero return code and leave (as usual) the failed command in the command line, BUT...
with the addition that the command after the error is not just whatever the user typed, but also includes the file-spec, fully expanded with path, etc?
Then there's no need for the user to retype, or RETRIEVE a potentially incomplete command and no need to re-navigate the selection panel if one was used.
The user simply adds the REP operand, or modifies the file-spec and, and then presses <ENTER> again.
- The third advantage to this approach is that you could easily implement the REPLACE command with very little, perhaps even no code at all.
REPLACE would be the same as CREATE but with the REP operand specified up front.
So REPLACE could be implemented by the addition of a SET ALIAS.REPLACE=CREATE REP
The only loss would be that there's no error message if the file named on a REPLACE command did not already exist.
No great drama in my book as you only end up with new file whose name you mis-spellt. Nothing was lost.
SAVEAS Command
With the above changes to CREATE/REPLACE, the SAVEAS command is effectively the same as the modified CREATE command, but with fewer operands, essentially allowing only REP and file-spec.
So its code is verbatim the same as CREATE, except that the line-control-range and X|NX and U|NU operands are not allowed by the definition.
You could even leave in the code supporting those unused operands. Commented out or wrapped with a suitable IF stmt, it would just never be executed.
(d) 'Default' Target Folder
Agree again with Robert although I think the EDIT/ASK/FM/ERROR approach is perhaps overkill given the nut you're trying to crack.
The confusion of "where did it go?" could be avoided, IF the message confirming the "data export process" included the fully-qualified filename instead of informing the user of how many lines were written.
In any case, a peek at the FM RECENT screen should clear up the issue if the user adds something like PATH(40) to the column display in OPTIONS - FM.
If there has to be a single 'default' directory where unspecified files go, please make it user-selectable (I guess from the OPTIONS-FM panel).
This allows users to tailor the facility to their own, possibly changing from time to time, needs.
Personally, I would set mine to "%USERPROFILE%\Desktop" because it
a) make such files easy to find
b) clutters up my desktop, thus encouraging me to be more specific next time!