moving up 1 directory when putting a file to URL

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

moving up 1 directory when putting a file to URL

Post by magice » Fri Apr 17, 2009 10:30 pm

When putting a file to URL you use \ to indicate the next directory just like the file path. Your starting point if not otherwise indicated is the folder your rev file is in. Is there a way to go up one directory from your start point without going all the way to the root?

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Post by bn » Fri Apr 17, 2009 11:04 pm

hi magice,

Code: Select all

on mouseUp pMouseBtnNo
    put the effective filename of this stack into temp -- effective in case it is a substack
    if temp is empty then 
        put "this stack has not been saved yet"
        exit mouseUp -- file has not been saved yet
    end if
    set the itemdelimiter to "/"
    put item 1 to -3 of temp & "/" -- the folder above original folder of where the stack is saved
end mouseUp
it should give you what you want
regards
Bernd

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Post by magice » Fri Apr 17, 2009 11:06 pm

perfect, thank you

Post Reply