2.17: TQOPEN | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
TOC | Group 1 | TQRCST | TQWSTR | Group 2 | A-Z | Group 1 |
Use TQOPEN to open a file for reading or writing by ChemApp.
TQOPEN has been partially superceded by TQOPNA and TQOPNB in ChemApp versions V3.3.0 and later, see the note below.
FORTRAN: CALL TQOPEN(NAME,UNIT,NOERR)
C: tqopen(name,unit,&noerr)
;
Pascal: tqopen(name,unit,noerr)
;
Basic: Call tqopen(name,unit,noerr)
Name | Type | Value set on call or returned |
NAME | CHARACTER | Set to the filename of the data-file to open |
UNIT | CHARACTER | Set to the unit number under which it should be opened |
NOERR | INTEGER | Returns an error number |
This routine is used to open files under a specific FORTRAN unit
number. Starting with ChemApp V3.3.0, it should only be used to open
files for writing. FORTRAN programmers may use the standard OPEN
statement instead, if ChemApp is used as a static library.
There are three standard cases where ChemApp application programs need to open files using TQOPEN:
Note that TQOPEN does not check whether the file to be opened already exists or not, since TQOPEN can be used both for opening existing files for reading, and new files for writing. Whether the file to be opened already exists should be checked prior to a call to TQOPEN.
If you receive an error 102 or 103 when reading the data-file with TQRFIL, and you find a file of zero bytes length under the name you passed to TQOPEN, this means that this file has just been created with the call to TQOPEN. It didn't exist before, and didn't get shortened, but created instead. It usually means that either the wrong filename was passed to TQOPEN, or the file was not located in the directory where the program expected it. The reason for this behaviour is that TQOPEN can both be used to open existing files for reading, as well as new files for writing.
Both problems mentioned above are resolved if TQOPNA is used instead of TQOPEN to open thermochemical data-files in ASCII format, TQOPNB to open binary data-files, and TQOPNT to open transparent data-files.
A file that has been opened using TQOPEN should subsequently be closed only with TQCLOS.
See TQWSTR
ChemApp Programmer's Manual, Edition 3.6 | © GTT-Technologies, 2003 |