Re: Re: drop down box or something like it.

"Jochen Ritzel" <[email protected]>
Newsgroups gmane.comp.windows.shells.litestep
Message-ID <op.ttrx2b1zd9nuum@w00t>
And now i will lead you away from the awful abomination that some call  
"xtextedit" and it's mangled, mutated syntax ( for which nothing but  
litestep is to blame for ) to the holy light of (actually reuseable) lua  
greatness:

function split ( p )
   -- yeah the pattern looks more complex, but thats because its alot more  
powerfull and works generally ^^
   return {p:gsub("/","\\"):match("^(.-)\\?((%w+)%.?(%w-))\\?$")}		
end

function basename( p )
   return split( p )[2]
end

function dirname( p )
   return split( p )[1]
end


--test code
path = "G:\\asdf\\Neuer Ordner\\test\\test.asd"
path2 = "test.asdf"
print( basename( path ) ) --> test.asd
print( dirname( path ) ) --> G:\asdf\Neuer Ordner\test
print ( basename(path2)) --> test.asdf
print( dirname( path2 )) --> ''


-----

Now, join me in my neverending quest to build, provide and use a nice  
lslua library ^^
~thc4k




---------------------------------------------------------------------
    Can't Unsubscribe? Check http://desktopian.org/listunsub.html
        LS List Homepage: http://wuzzle.org/list/litestep.php
            Get the LS FAQ: http://lsfaq.shellfront.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.