2.13: TQCIO | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
TOC | Group 1 | TQGIO | TQRFIL | Group 2 | A-Z | Group 1 |
Using TQCIO, input and output from ChemApp can be redirected to another unit than the default, or a different language be selected for the error messages than the default (see Table 6).
FORTRAN: CALL TQCIO(OPTION,IVAL,NOERR)
C: tqcio(option,ival,&noerr)
;
Pascal: tqcio(option,ival,noerr)
;
Basic: Call tqcio(option,ival,noerr)
Name | Type | Value set on call or returned |
OPTION | CHARACTER | Set to a string as shown in Table 6 |
IVAL | INTEGER | Set to a legal unit number, or to a language index |
NOERR | INTEGER | Returns an error number |
OPTION and IVAL are both input, and are used to identify the input/output option (see Table 6). Unit numbers entered must be <= 10 or >= 20 to be valid. Error messages will not be output if IVAL is set to zero for option ERROR.
A file has to be opened under this new unit number in the application program if default values are changed for the options ERROR and LIST. TQOPEN and TQCLOS should be used for this purpose.
FORTRAN: | View plain source code |
C Change values of input/output options
PROGRAM CAF6 IMPLICIT NONE
INTEGER NOERR, NPHASE
C Initialise ChemApp CALL TQINI(NOERR)
C Change the language for error messages to Swedish CALL TQCIO('LANGUAGE ', 4, NOERR)
C Trigger a ChemApp error by trying to get the number of phases C before even having read a thermochemical data-file CALL TQNOP(NPHASE, NOERR)
Output:
Fel nummer: 104 En fil med termodynamiska data maste foerst inlaesas Felet upptraedde sedan "TQNOP " anropats |
END
C: | View plain source code |
/* Program cac6 */ /* Change values of input/output options */
#include "cacint.h"
int main() { LI noerr, nphase;
/* Initialise ChemApp */ tqini(&noerr);
/* Change the language for error messages to Swedish */ tqcio("LANGUAGE", 4, &noerr);
/* Trigger a ChemApp error by trying to get the number of phases before even having read a thermochemical data-file */ tqnop(&nphase, &noerr);
Output:
Fel nummer: 104 En fil med termodynamiska data maste foerst inlaesas Felet upptraedde sedan "TQNOP " anropats |
return 0;
}
ChemApp Programmer's Manual, Edition 3.6 | © GTT-Technologies, 2003 |