NDog (1st post):
| However if possible, could I simply put it in one line, that doesn't
| rely on creating a temp file?
| for example;
| set x= dir /b *.t | %@select[CON,12,50,18,70,NRS3]
NDog wrote(3rd post):
| A more advanced question, that might not be possible on one line
| directory listing of
| 1. *.btm
| 2. sorted by time last accessed
| 3. displaying filename - filedate - timeaccessed
| 4 into a @select menu
| 5. set x to the chosen value
Ndog (4th post):
| working now;
| for /f %a in ('dir /b /O-D /T:a *.btm') do (echo %@format[-12,%@left
| [-4,%a]] - updated %@filedate[%a,,2] %@filetime[%a,w] ) | set x=%@word
| [0,%@select[con,2,20,18,70,NRS3]].btm
Please be careful to read how piping works in 4DOS. It actually creates a
temporary file, which is automatically deleted when the command is
completed, thus your approach does not meet the criterion you specified in
your OP (quoted above). If your sole purpose for piping is to eliminate the
need for manual deletion of the temporary file, your solution of that issue
is good. But beware: other command processors (e.g., 4nt, tcc, etc. - don't
know about CMD.EXE) may implement piping by the use of additonal instances
of the command processor, which have their own distinct set of environment
variables, thus an environment variable which is set on the right side of a
pipe dies unaccessibly when the command is completed.
Your real problem, however, may be different. What is your file system? If
it is a FAT variant (FAT32, VFAT), it does NOT save the time of day of last
access, only its date! Sorting by "last accessed" is by access date only.
Only if you use NTFS is the sorting as you intended.
There are other issues with your solution. Display is name, modification
date and modification time. This is what "updated" implies, but not what you
specified in the 3rd post. The name would be simpler using @NAME instead of
the @LEFT. @filetime does not require the 2nd parameter (,w) - it is the
default as it is for @filedate, where you explicitly skipped it. Lastly, the
word "updated" implies that the file is not in its original version (at
times the first version of a program actually performs its intended purpose,
so it is not "updated").
--
Steve