2.5: TQGTID | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
TOC | Group 1 | TQLITE | TQGTNM | Group 2 | A-Z | Group 1 |
Use TQGTID to get the user ID of the license holder of the ChemApp library.
Added for ChemApp version 4.0.0
FORTRAN: CALL TQGTID(ID,NOERR)
C: tqgtid(id,&noerr)
;
Pascal: tqgtid(id,noerr)
;
Basic: Call tqgtid(id,noerr)
Name | Type | Value set on call or returned |
ID | CHARACTER | Returns the user ID (255 chars) |
NOERR | INTEGER | Returns an error number |
TQGTID returns the user ID of the license holder of ChemApp.
Note that the user ID which is returned can be up to 255 characters
long, the variable ID
should thus be declared large enough to hold
a character string of this length.
FORTRAN: | View plain source code |
C Retrieving and displaying the user ID and the name of the ChemApp C license holder, the program ID, HASP dongle information, plus the C expiration date of the ChemApp license.
C If the ChemApp version used requires a HASP dongle, and the ChemApp C license is expired, or about to expire, and is to be extended, the C information printed by this program is needed by GTT-Technologies to C update the dongle.
C The support function STRLEN returns the total number of characters in C a string, not counting trailing blanks INTEGER FUNCTION STRLEN(INSTR) CHARACTER INSTR*(*)
STRLEN = LEN(INSTR) DO WHILE(INSTR(STRLEN:STRLEN) .EQ. ' ') STRLEN = STRLEN - 1 IF (STRLEN .EQ. 1) RETURN ENDDO RETURN END
PROGRAM CAF30 IMPLICIT NONE
INTEGER NOERR, STRLEN, HASPID, EDMON, EDYEAR CHARACTER ID*255, NAME*80, PID*24, HASPT*5
C Initialise ChemApp CALL TQINI(NOERR)
C Retrieve the licensee's user ID CALL TQGTID(ID,NOERR)
C Retrieve the licensee's name CALL TQGTNM(NAME,NOERR)
C Retrieve the program ID CALL TQGTPI(PID,NOERR)
C Print all three WRITE(UNIT=*,FMT=*) 'Licensee''s user ID: ', ID(1:STRLEN(ID)) WRITE(UNIT=*,FMT=*) 'Licensee''s name : ', NAME(1:STRLEN(NAME)) WRITE(UNIT=*,FMT=*) 'Program ID : ', PID(1:STRLEN(PID))
Output:
Licensee's user ID: 5001 Licensee's name : GTT - Technologies Program ID : CAFU |
C The following pieces of information are only meaningful if a version C of ChemApp is used that requires a dongle (hardware key). C Get the HASP dongle type and id CALL TQGTHI(HASPT, HASPID, NOERR)
C Get the ChemApp license expiration date (month and year) CALL TQGTED(EDMON, EDYEAR, NOERR)
C Print info if HASP dongle is used: IF (HASPID .NE. 0) THEN WRITE(UNIT=*,FMT=*) 'HASP dongle type : ' // * HASPT(1:STRLEN(HASPT)) WRITE(UNIT=*,FMT=*) 'HASP dongle id : ', HASPID
WRITE(UNIT=*,FMT=*) 'ChemApp license expiration date ' // * '(month/year): ', EDMON, '/', EDYEAR ELSE WRITE(UNIT=*,FMT=*) 'This ChemApp version does not ' // * 'require a HASP hardware key (dongle)' ENDIF
Output:
This ChemApp version does not require a HASP hardware key (dongle) |
END
C: | View plain source code |
/* Program cac30 */ /* Retrieving and displaying the user ID and the name of the ChemApp license holder, as well as the program ID */
/* If the ChemApp version used requires a HASP dongle, and the ChemApp license is expired, or about to expire, and is to be extended, the information printed by this program is needed by GTT-Technologies to update the dongle. */
#include "cacint.h"
int main() { LI noerr, haspid, edmon, edyear;
char id[255], name[80], pid[TQSTRLEN], haspt[TQSTRLEN];
/* Initialise ChemApp */ tqini(&noerr);
/* Retrieve the licensee's user ID */ tqgtid(id, &noerr);
/* Retrieve the licensee's name */ tqgtnm(name, &noerr);
/* Retrieve the program ID */ tqgtpi(pid, &noerr);
/* Print all three */ printf("Licensee's user ID: %s\n", id); printf("Licensee's name : %s\n", name); printf("Program ID : %s\n", pid);
Output:
Licensee's user ID: 5001 Licensee's name : GTT - Technologies Program ID : CAFU |
/* The following pieces of information are only meaningful if a version of ChemApp is used that requires a dongle (hardware key). Get the HASP dongle type and id */ tqgthi(haspt, &haspid, &noerr);
/* Get the ChemApp license expiration date (month and year) */ tqgted(&edmon, &edyear, &noerr);
/* Print info if HASP dongle is used: */ if (haspid) { printf("HASP dongle type : %s\n", haspt); printf("HASP dongle id : %li\n", haspid); printf("ChemApp license expiration date (month/year): %li/%li\n", edmon, edyear); } else { printf("This ChemApp version does not require a " "HASP hardware key (dongle)\n"); }
Output:
This ChemApp version does not require a HASP hardware key (dongle) |
return 0;
}
ChemApp Programmer's Manual, Edition 3.6 | © GTT-Technologies, 2003 |