Posts: 1,271
Threads: 399
Joined: Mar 2003
i just wonder:
getfilename extracts the filename part from file.
s.getfilename([file] [ext])
is there a qm function which returns the [ext] ?
Posts: 1,271
Threads: 399
Joined: Mar 2003
this is what i use:
(shortcut drop example)
Quick Macros :: View topic - macro shortcut syntax
qm_desktop_icon
function $files
str ext.get(_command findcr(_command '.')+1)
str name.getfilename(_command)
str name_ext.getfilename(_command 1)
sel ext
,case "ini"
,,out "make some %s stuff with %s " ext name_ext
,,
,case else end
Posts: 12,092
Threads: 142
Joined: Dec 2002
Member function str.GetFileExt
function [$pathname]
;Gets filename extension.
;pathname - file name with or without path. Default: itself.
;EXAMPLE
;str s
;s.GetFileExt("c:\aaa\fff.eee")
;out s
if(!pathname) pathname=this
int i=findcr(pathname '\')+1
int j=findcr(pathname '.')+1
if(j>i) this.get(pathname j); this.trim("''")
else this=""