To create a folder hierarchy for the storage of files, I am presenting this algorithm. You should h
To create a folder hierarchy for the storage of files, I am presenting this algorithm. You should have your file name as numeric one like
Rate To create a folder hierarchy for the storage of files, I am presenting this algorithm. You should h
(1(1 Vote))
'Purpose : Returns the folder and sub folder for developing the path
' i.e. folder\SubFolder\FileName.tif
'Algorithm : Recursively divide filename by 256 unless the quotient
' becomes less than 10. As a result of this division,
' the final quotient is the folder and the remainder is the SubFolder.
'Parameters : input = file name; output= folder, subfolder
Function div(ByVal dblNum, dblFolder, dblSubFolder) As Boolean
Dim pos As Integer
Dim str1 As Double
Dim dblQuotient As Double
dblQuotient = dblNum / 256
If dblQuotient >= 1 Then
pos = InStr(1, LTrim(Str(dblQuotient)), ".", vbTextCompare)
If pos > 0 Then
dblQuotient = Mid(LTrim(Str(dblQuotient)), 1, (pos - 1))
End If
If dblQuotient > 2560 Then
div dblQuotient, dblFolder, dblSubFolder
Else
str1 = dblQuotient
dblFolder = dblQuotient / 256
If dblFolder >= 1 Then
pos = InStr(1, LTrim(Str(dblFolder)), ".", vbTextCompare)
If pos > 0 Then
dblFolder = Mid(LTrim(Str(dblFolder)), 1, (pos - 1))
Else
dblFolder = dblFolder
End If
dblSubFolder = str1 Mod 256
Else
dblSubFolder = dblFolder * 256
dblFolder = 0
End If
End If
Else
dblFolder = 0
dblSubFolder = 0
End If
div = True
End Function
To create a folder hierarchy for the storage of files, I am presenting this algorithm. You should h Comments
No comments yet — be the first to post one!
Post a Comment