Precautions
To avoid malfunction of your programs, please note the advise below:
- Choose unique file names.
If the same file id is used inside multiple objects, this can cause serious problems. - Make sure that the allocated file is not in use.
Only indexed files and relative IO files will be opened and closed automatically. For other files, you will have to make sure that the file that you call in your logic is closed whenever that call is executed. Therefore you should close the file just before that specific call. This can be done by using the .CLOSE file-property (<fileid>.CLOSE). If you do not write that command before the call, this could easily lead to sharing conflicts. - Be aware that handling of file-locks depends on the type of the object that uses the file.
Therefore, please look at the following differences:
- When calling files in a report:
- Files will be locked until the report has finished.
- When calling files in a form:
- Files will be locked until the end of the transaction.
- Files will be closed whenever a screen is transmitted. This means that at the end of a screen transaction, the instruction <File ID>.CLOSE () is performed automatically. - When calling files in a global routines dll:
- Files will be locked until the end of the call.
- When calling files in a report:
Before using indexed or relative IO files, please also note the advise below:
- Only use these file options if necessary.
For every action, these files will be opened and closed. This way, multiple reports can use these files at the same time. However, this also causes a decrease in performance. - Do not use these options in combination with the file functions .READ, .READFILE, .FILEWRITE and .SORT.
Doing this would cause unpredictable results. - If you have linked multiple indexes to a file, make sure that these indexes are defined for all reports and forms that use this file.
If you would not do this, the missing index will be created again for every new file call and because of that the performance will decrease.