Vorheriges Thema: ExistFile - Überprüfen, ob eine Datei vorhanden istNächstes Thema: FindFirst - Zurückgeben des Namens der ersten bei der Suche gefundenen Datei


FindClose - Abschließen eines Suchvorgangs

Gültig für NetWare, Symbian OS, UNIX, Windows und Windows CE.

Die Funktion "FindClose" schließt einen Suchvorgang ab.

Funktionssyntax:

FindClose(Handle as Integer) as Boolean
handle

Gibt das Handle des abzuschließenden Suchvorgangs an.

Bei erfolgreichem Abschluss gibt die Funktion TRUE zurück, andernfalls FALSE.

Beispiel:

Function contents(root as string) As Boolean
	Dim fileName As String
	Dim iHandle As Integer
	Dim rootRoot As String
	
	rootRoot = Mid(root, 0, len(root)-1)
	iHandle = FindFirstFile(root, fileName)) Then
	If iHandle = 0 Then
		Print("No files found at """ + root + """")
	Else
		Wiederholen
			If Is_Dir(rootRoot + fileName) Then
				Print("""" + rootRoot + fileName + """ is a directory")
				if Not(fileName = ".") AND Not(fileName = "..") Then
					contents(rootRoot + fileName + "\*")
				End If
			Else
				Print("""" + rootRoot + fileName + """ is a file")
			End If
		Until Not(FindNextFile(iHandle, fileName))

		FindClose(iHandle)
	End If
	contents = TRUE
End Function

Dim i As Integer
ClrScr()
if Argc() = 1 Then
	Beenden
End If
For i=1 To Argc()-1
	Print(NEWLINE$ + "Recursive List of """ + Argv(i) + """")
	Contents(Argv(i))
Next i

Invokation: dmscript sample.dms c:\* -w_dms

Weitere Informationen:

FindFirstFile - Suchen nach Dateien in einem Verzeichnis