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.
LOCAL lcUNCString AS String
m.lcUNCString = "\\A machine\A Share$\A folder"
MESSAGEBOX([UNC Share for "] + m.lcUNCString + [" is "] + JustUNCShare(m.lcUNCString) + ["])
m.lcUNCString = "\\A machine\A Share$"
MESSAGEBOX([UNC Share for "] + m.lcUNCString + [" is "] + JustUNCShare(m.lcUNCString) + ["])
m.lcUNCString = "\\A machine"
MESSAGEBOX([UNC Share for "] + m.lcUNCString + [" is "] + JustUNCShare(m.lcUNCString) + ["])
FUNCTION JustUNCShare (tcUNCResource AS String)
ASSERT TYPE("m.tcUNCResource") = "C" MESSAGE "JustUNCShare() requires a string for parameter"
IF !"_REGEXP.VCX" $ SET("Classlib")
SET CLASSLIB TO (ADDBS(HOME(1)) + "ffc\_regexp.vcx") ADDITIVE
ENDIF
LOCAL loRegExpr AS _regexp
m.loRegExpr = CREATEOBJECT("_regexp")
m.loRegExpr.Pattern = "^\\\\[^\\]*\\[^\\]*"
RETURN IIF(m.loRegExpr.Execute(m.tcUNCResource,.F.) = 1, m.loRegExpr.Matches[1,2], "")
ENDFUNC
lcUNCString = '\\das\share$\myDir'
If Left(Alltrim(lcUNCString),2) = '\\'
lcUnc=Left(lcUNCString, At('\',lcUNCString,4)-1)
?lcUnc
Endif
LOCAL lcUNCTests AS String
TEXT TO m.lcUNCTests NOSHOW FLAGS 1
\\machine\share\\machine\share
\\machine\share\sub\\machine\share\sub
\\machine\\machine
ENDTEXT
LOCAL ARRAY laUNCTests(1)
ALINES(m.laUNCTests,m.lcUNCTests)
LOCAL lcUNCTest AS String
CLEAR
FOR EACH m.lcUNCTest IN m.laUNCTests
? '"' + m.lcUNCTest + '" -> "' + JustUNCShare(m.lcUNCTest) + '"'
ENDFOR
FUNCTION JustUNCShare (tcUNCResource AS String)
ASSERT TYPE("m.tcUNCResource") = "C" MESSAGE "JustUNCShare() requires a string for parameter"
IF !"_REGEXP.VCX" $ SET("Classlib")
SET CLASSLIB TO (ADDBS(HOME(1)) + "ffc\_regexp.vcx") ADDITIVE
ENDIF
LOCAL loRegExpr AS _regexp
m.loRegExpr = CREATEOBJECT("_regexp")
m.loRegExpr.Pattern = "^\\\\[^\\]*\\[^\\]+"
RETURN IIF(m.loRegExpr.Execute(m.tcUNCResource,.F.) = 1, m.loRegExpr.Matches[1,2], "")
ENDFUNC
myself said:that again speaks for determining the available space of a certain folder anyway