Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
Procedure.s CommonPath(Array InPaths.s(1),separator.s="/")
|
||||
Protected SOut$=""
|
||||
Protected i, j, toggle
|
||||
|
||||
If ArraySize(InPaths())=0
|
||||
ProcedureReturn InPaths(0) ; Special case, only one path
|
||||
EndIf
|
||||
|
||||
Repeat
|
||||
i+1
|
||||
toggle=#False
|
||||
For j=1 To ArraySize(InPaths())
|
||||
If (StringField(InPaths(j-1),i,separator)=StringField(InPaths(j),i,separator))
|
||||
If Not toggle
|
||||
SOut$+StringField(InPaths(j-1),i,separator)+separator
|
||||
toggle=#True
|
||||
EndIf
|
||||
Else
|
||||
ProcedureReturn SOut$
|
||||
EndIf
|
||||
Next
|
||||
ForEver
|
||||
EndProcedure
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
Dim t.s(2)
|
||||
t(0)="/home/user1/tmp/coverage/test"
|
||||
t(1)="/home/user1/tmp/covert/operator"
|
||||
t(2)="/home/user1/tmp/coven/members"
|
||||
|
||||
Debug CommonPath(t(),"/"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue