If you can't seem to eliminate throwing this exception, then the answer is to
look for a different file opened previously with an invalid or missing
filename. For example, assume the following code:
Dim FileName15, FileName16 As String
Filename15 = "mytextfile.txt"
Fileopen(15, FileName15, Mode.Output)
Fileopen(16, FileName16, Mode.Output)
Print(15,...)
Even though we are only writing to unit 15 (which has a valid file name),
the exception nevertheless gets thrown because the filename for 16 was never
defined. This means that you will get "Path/File access error" messages
when writing to file with valid filenames when the true problem is because
there is a filename problem with another file that was opened.
In short, when it seems impossible to locate the source of this error
message, you must search above the line where the error is being thrown and
look for a file that was opened that did not have a valid file name.
Examples of invalid files names are:
1. Never initializing a filename (i.e., Dim filename as string)
2. Illegal character usage in filename string, for example: c:\\myfile.txt
3. Not using the string type for filenames (i.e., Dim filename as Integer)
LP