Close All Files Method
The Close All Files method closes every open file and writes to disk any data that currently resides in the operating system buffers. It does not return a value.
Format
Reset
This method does not include any arguments.
Example
The following example creates a file, puts the numbers 1 through 10 in this file, and then attempts to get past the end of the file. The On Error statement handles the error and Siebel VB continues to the Debugger code. This code uses the Reset statement to close the file before it exits:
Sub Button_Click
' Put the numbers 1-10 into a file
Dim x as Integer
Dim y as Integer
On Error Goto Debugger
Open "c:\temp001" as #1 Len = 2
For x = 1 to 10
Put #1,x, x
Next x
Close #1
msgtext = "The contents of the file is:" & Chr(10)
Open "C:\TEMP001" as #1 Len = 2
For x = 1 to 10
Get #1,x, y
msgtext = msgtext & Chr(10) & y
Next x
done:
Close #1
Kill "c:\temp001"
Exit Sub
Debugger:
TheApplication.RaiseErrorText "Error " & Err & " occurred. Closing open file."
Reset
Resume done
End Sub