-- get_multiple.prg -- To open the latest version Medusa sheets that has been saved with a version extension similar to the VMS system -- This is intended to be a general use tool with the file name up to the .extn passes via the variable "tms" errpau off --errmes off --reset the variables used in the program to null let dot = '' let ext = '' let ver = '' let data = '' if (exists('got.srt')) then --tidy up the previous file got.srt (if found) delete got.srt endif IF (OS$TYP .EQ. 'win_nt')then !dir /b @vtms.she.* |sort1a > got.srt else !ls -a1 @vtms.she.* | sort1 >got.srt endif -- errmes on -- slist got.srt open read inf got.srt loop read read inf data if then break read endif endloop read close inf if (data .ne. '') then let dot = (index((data);'.she')) --write ' Position of the first dot = @vdot' errmes off -- if the file does not have a version extension the following line will give an error let ext = (data[((dot)+5);-1]) errmes on if (ext .eq. '') then -- the file has not been saved with a version number let ver = '' let dt = '' else let ver = (eval(ext)) -- the latest version of the file let dt = '.' -- provide the dot after the "she" endif write ' ' she @vtms.she@vdt@vver write 'The current Medusa sheet file is now @vfil' else write ' No version of @vtms.she@vdt@vver file is available - see MRN if you think that it should be' write ' ' write 'The current Medusa sheet file remains @vfil' endif errmes on errpau on