06-05-2025, 12:57 PM
(06-05-2025, 12:23 PM)PhilOfPerth Wrote:(06-05-2025, 11:18 AM)PhilOfPerth Wrote:(06-05-2025, 09:30 AM)RhoSigma Wrote: Jesus Christ boys, where do you live?
KILL "path/POP*" and be done with it.
The problem with both of these is that the character after POP varies for each file. Kill "path/POP* doesn't accept the * - it doesn't like the * and returns File Not Found.
(06-05-2025, 08:43 AM)bplus Wrote: or more QBistically and less DOS like:
If Ucase$(Left$(filename$, 3)) = "POP" Then Kill filename$
Sorry bplus, I missed your suggestion. I'll give that a go now. Thanks
Thanks all. With bits from each of the help responses, I was able to modify the kill process to work.
There was an additional part to the problem: the "POP" section could be anything, so the path might be for example RecallHist/EDWARD2, so the position of the name within the string is variable, as well as the end character. I fixed it with this line (where HistString$ is the path, and Name$ was previously entered as POP, or EDWARD etc.):
If Mid$(HistString$, 12, Len(Name$)) = Name$ Then kill HistString$
The amount of help, as usual, was incredible, and much appreciated.
MY Suggestion on using the Shell command *WILL* work with wildcards as well.