Squashman wrote:Hi Antonio,
I like your code. Short and sweet.
But can we really assume that the file with the newest time stamp has the highest number?
What happens when some one edits file 2 of 4.Code: Select all
But you could use the Creation date to force it back into order.Code: Select all
But maybe a better solution would be to just use an IF statement to compare all possibilities.Code: Select all
Of course there is only so much Human Error checking you can do. Some idiot could put the letter A inside the parentheses and A would become the largest value. If someone deletes the base file name from the backup folder the next time that file comes in, it would become the first base file name with no number.
foxidrive wrote:Antonio, your code relies on the files remaining static, is that right?
I made this comment earlier - the OP didn't reply though.foxidrive wrote:What will happen to all these files? Will any of them ever be removed?
if you remove say file 5 then the code will need extra checking...
When a request have not enough specifications, I try to answer it via the simplest solution that fulfill the request as stated. If the OP have interest and reply with additional specifications then I evaluate a possible improvement of my code, but unfortunately this point not always happen. It is frequent that the OP never answer or just say "thanks" with no detail about how my code behaves. In this case, any effort made to improve the first solution was wasted time (and sam14189 had just proved this point)...

Antonio