Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
The original post was to find the root of a folder. I must confess that I read that as "parent".But surely that only works if the file is one-level down from the root?
CLEAR
m1 = "c:\my pictures\my aviation pictures\aviation"
? LEFT(m1,AT([\],ADDBS(m1),2))
m1 = "c:\my pictures\my aviation pictures"
? LEFT(m1,AT([\],ADDBS(m1),2))
m1 = "c:\my pictures"
? LEFT(m1,AT([\],ADDBS(m1),2))
FUNCTION folderbefore
PARAMETERS mytarget
*!* mytarget is the previously used path
a = substr(mytarget ,len(mytarget),1)
IF a='\'
N = 0
ELSE
N = 1
ENDIF
Start = 1
DO while start # 0
Start = rat('\',mytarget )
mytarget = subst(mytarget,1,start - 1)
IF n = 1
mypictarget = mytarget
EXIT
ENDIF
N = n+1
*!* new path = mypictarget
ENDDO
? mypictarget
RETURN mypictarget