Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Killing files
#1
I have a folder called RecallHist containing several files with names like "ABC4, ABC6, POP1, POP6, AB1, BD3
and I need to delete those that start with POP (for example).
I've written this code, but the selection$ string is not correct - file is not found.
Code: (Select All)
Name$ = "POP"
Print "Name$ is "; Name$
NewHist:
k = _KeyHit
_Limit 30
If k <> 21248 Then GoTo NewHist '                wait for Delete key
selection$ = "RecallHist/" + Name$ + "?" '    <----------------------------------- this line is wrong - file is not being found
Print "selection$ is "; selection$
If _FileExists(selection$) Then
    Kill selection$ '                            delete files in RecallHist that start with POP plus any other char
    Print "Killed"; selection$ '                  deleted history files for this name
Else
    Print "History still intact" '                not deleted
End If

How do I place a Wildcard in the string?
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


Messages In This Thread
Killing files - by PhilOfPerth - 06-05-2025, 04:16 AM
RE: Killing files - by ahenry3068 - 06-05-2025, 04:29 AM
RE: Killing files - by SMcNeill - 06-05-2025, 05:40 AM
RE: Killing files - by bplus - 06-05-2025, 08:43 AM
RE: Killing files - by RhoSigma - 06-05-2025, 09:30 AM
RE: Killing files - by OldMoses - 06-05-2025, 10:41 AM
RE: Killing files - by PhilOfPerth - 06-05-2025, 11:18 AM
RE: Killing files - by PhilOfPerth - 06-05-2025, 12:23 PM
RE: Killing files - by ahenry3068 - 06-05-2025, 12:57 PM
RE: Killing files - by ahenry3068 - 06-05-2025, 11:13 AM
RE: Killing files - by Kernelpanic - 06-05-2025, 12:14 PM
RE: Killing files - by RhoSigma - 06-05-2025, 12:21 PM
RE: Killing files - by Pete - Yesterday, 09:48 PM



Users browsing this thread: 1 Guest(s)