Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Killing files
#11
(Yesterday, 11:18 AM)PhilOfPerth Wrote:
(Yesterday, 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.

(Yesterday, 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.
            
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, Western Australia.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply
#12
(Yesterday, 12:23 PM)PhilOfPerth Wrote:
(Yesterday, 11:18 AM)PhilOfPerth Wrote:
(Yesterday, 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.

(Yesterday, 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.
Reply




Users browsing this thread: 1 Guest(s)