2.24: TQGSU | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
TOC | Group 1 | TQGTRH | TQCSU | Group 2 | A-Z | Group 1 |
Use TQGSU to find out what unit is currently in use for a specified quantity.
FORTRAN: CALL TQGSU(OPTION,UNIT,NOERR)
C: tqgsu(option,unit,&noerr)
;
Pascal: tqgsu(option,unit,noerr)
;
Basic: Call tqgsu(option,unit,noerr)
Name | Type | Value set on call or returned |
OPTION | CHARACTER | Set to a string as shown in Table 7 |
UNIT | CHARACTER | Returns a string as shown in Table 7 |
NOERR | INTEGER | Returns an error number |
OPTION is character input identifying the quantity. UNIT is character output with values as shown in Table 7. The quantities and units available are those also available in ChemSage Version 4.
FORTRAN: | View plain source code |
C Get and display the system units
PROGRAM CAF8 IMPLICIT NONE
INTEGER NOERR CHARACTER UNIT*24
C Initialise ChemApp CALL TQINI(NOERR)
C Get default system units WRITE(UNIT=*,FMT='(A)') 'Default system units:'
CALL TQGSU('Pressure ',UNIT,NOERR) WRITE(UNIT=*,FMT='(A)') 'Pressure unit: ' // UNIT
CALL TQGSU('Volume ',UNIT,NOERR) WRITE(UNIT=*,FMT='(A)') 'Volume unit: ' // UNIT
CALL TQGSU('Temperature ',UNIT,NOERR) WRITE(UNIT=*,FMT='(A)') 'Temperature unit: ' // UNIT
CALL TQGSU('Energy ',UNIT,NOERR) WRITE(UNIT=*,FMT='(A)') 'Energy unit: ' // UNIT
CALL TQGSU('Amount ',UNIT, NOERR) WRITE(UNIT=*,FMT='(A)') 'Amount unit: ' // UNIT
Output:
Default system units: Pressure unit: bar Volume unit: dm3 Temperature unit: K Energy unit: J Amount unit: mol |
END
C: | View plain source code |
/* Program cac8 */ /* Get and display the system units */
#include "cacint.h"
int main() { LI noerr; char unit[TQSTRLEN];
/* Initialise ChemApp */ tqini(&noerr);
/* Get default system units */ printf("Default system units:\n");
tqgsu("Pressure",unit,&noerr); printf("Pressure unit: %s\n", unit);
tqgsu("Volume",unit,&noerr); printf("Volume unit: %s\n", unit);
tqgsu("Temperature",unit,&noerr); printf("Temperature unit: %s\n", unit);
tqgsu("Energy",unit,&noerr); printf("Energy unit: %s\n", unit);
tqgsu("Amount",unit, &noerr); printf("Amount unit: %s\n", unit);
Output:
Default system units: Pressure unit: bar Volume unit: dm3 Temperature unit: K Energy unit: J Amount unit: mol |
return 0;
}
ChemApp Programmer's Manual, Edition 3.6 | © GTT-Technologies, 2003 |