Hi,
I've tried the following:
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
Dim f As VBFileHandler
Dim s As String
f = Open(fileName, Input, Read, Shared)
If f <> Null Then
Do While Not f.EOF
s = f.readLine
....
loop
end if
f.close
|
This code creates an empty file, if "fileName" does not exist.
To avoid this behaviour, I am now using:
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
Dim f As VBFileHandler
Dim s As String
f = Open(fileName, Input, Read, Shared)
If f <> Null Then
if f.exists then
Do While Not f.EOF
s = f.readLine
....
loop
f.close
end if
end if
|
The "f.close" has to be omitted, unless you opened an existing file.
Greetings
A1880