Turns out you and I think alike also - I latched on to a GDG-style labelling too.
BACKVIEW.MACRO takes a negative (-1, -2) argument to VIEW a backup file and its messages speak of "generations".
The reason I think the backup file names are hard to read, is that, as a European, my brain is trained to take in dates in DD/MM/YY format.
As you're based state-side, you probably feel the same about MM/DD/YY.
The files are named with YYMMDD, which for me, espcially without separators, takes more brain cycles to interpret (hard to find with increasing age).
That's why I opted to show the generations to the user with a DD/MM/YYYY date format and placed separators between the timestamp values.
If you prefer a MM/DD/YY sequence, simply change the DA/MO/20YR literal to MO/DA/20YR around about line 96 in the code.
Onwards to your new idea, built-in backup retrieval for VIEW and BROWSE, eg:
VIEW MYNAME.TXT BACKUP 1
BROWSE MYNAME.TXT BACKUP 1
Very doable with one (although technially two) macros.
(I've used this technique in the past to enhance LOCATE with additional capability.)
Create a V.MACRO to 'front-end' the VIEW command.
(I use the V abbreviation as that's what most folks probably type and leave VIEW for use if I really wanted to call the original directly, eg from within a macro)
The V.MACRO command would be
V <filename> -g <any/all usual VIEW arguments>
The macro would:
cmd$ = IIF$(Get_MacName$="V", "VIEW", "BROWSE")
SPF_PARSE the argument string for the presence of a -g generation request.
If none is found, it will issue a SPF_POST_DO(cmd$+" <all aguments> (ENTER)") and stop.
The rest of the macro would be a subset of BACKVIEW:
- Check for a backup -> Halt(FAIL,error msg) if none
- Ensure requested generation exists -> Halt(FAIL,error msg) if unavailable
- Deal with the Backup file's STATE file if required
- Modify the original argument to
- Replace filename with backup file's path+name
- Remove the -g argument
Issue a SPF_POST_DO(cmd$+" <modified aguments> (ENTER)")
And stop
To implement BROWSE, make a B.MACRO which consists of #INCLUDE V.MACRO.