Hi Everyone,
Can someone help me out with this code to create a directory structure? This program doesn't compile right now.
Is there any better way to create a directory using mapinfo? I copied this code from a web-link.
http://users.turboline.be/btl10148/tips/tip044.htm
Declare sub CreateNewDirectory(NewDirectory As String)
Declare Sub Main
Type SECURITY_ATTRIBUTES
nLength As Integer
lpSecurityDescriptor As Integer
bInheritHandle As Logical
End Type
Declare Function CreateDirectory Lib "kernel32" Alias "CreateDirectoryA" (ByVal lpPathName As String,
lpSecurityAttributes As SECURITY_ATTRIBUTES) As Integer
Sub Main
Dim mydir as String
mydir = "C:\Temp\vbtest"
Call CreateNewDirectory(mydir)
End Sub
Sub CreateNewDirectory(NewDirectory As String)
Dim sDirTest As String
Dim i_var as integer
Dim iFlag as SmallInt
Dim SecAttrib As SECURITY_ATTRIBUTES
Dim bSuccess As logical
Dim sPath As String
Dim iCounter As Integer
Dim sTempDir As String
iFlag = 0
sPath = NewDirectory
If ( Right$(sPath, Len(sPath)) <> "\" )Then
sPath = sPath & "\"
End If
iCounter = 1
Do Until InStr(iCounter, sPath, "\") = 0
iCounter = InStr(iCounter, sPath, "\")
sTempDir = Left$(sPath, iCounter)
sDirTest = PathToDirectory$(sTempDir)
iCounter = iCounter + 1
'create directory
i_var = &HO0
SecAttrib.lpSecurityDescriptor = i_var
SecAttrib.bInheritHandle = False
SecAttrib.nLength = Len(SecAttrib)
bSuccess = CreateDirectory(sTempDir, SecAttrib)
Loop
End Sub
---------------------------------------------------------------------- To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
