Fileops
'========================================================================|
' Fileops is a set functions to manipulate file names and paths. |
' QUOTE - Returns a quoted string |
' STRIPPATH - Returns file path (without file name) |
' STIPFILENAME - Returns file name (without path) |
' STRIPFILEEXT - Returns file extension (like ".exe", ".html" etc.) |
' FILENAMENOEXT - Returns file name without extension |
' FULLPATHNOEXT - Returns full path without file extension |
'========================================================================|
$include "fileops.inc"
declare sub file_operations
create form as qform
center
width = 500
create fl as qfilelistbox
align = 3
ondblclick = file_operations
end create
create re as qrichedit
align = 5
font.name = "Courier new"
wordwrap = 0
end create
showmodal
end create
sub file_operations
re.clear
dim sta as string
sta = fl.filename
re.addstrings "ORIGINAL FILE NAME" + chr$(9) + sta, _
"QUOTED FILE NAME" + chr$(9) + quote(sta), _
"FILE PATH" + chr$(9) + chr$(9) + StripPath(sta), _
"FILE NAME" + chr$(9) + chr$(9) + stripfilename(sta), _
"FILE EXTENSION" + chr$(9) + stripfileext(sta), _
"WITHOUT EXTENSION" + chr$(9) + filenamenoext(sta), _
"FULL NAME (NO EXT)" + chr$(9) + fullpathnoext(sta)
end sub
|