CONNTEST_RESULT
The keyword CONNTEST_RESULT
is used to obtain the results of the most recently executed connection test in string form. The level of detail contained in the returned string is controlled by the debugLevel parameter passed to the CONNTEST function.
CONNTEST_RESULT was added in XJTAG v2.2 and is not recognised in versions prior to that.
Syntax
CONNTEST_RESULT( INT index )
Parameters
- index
- The index of the error to retrieve. This value should be greater than or equal to zero and less than the total number of errors as returned by CONNTEST.
Return value
A STRING value containing the specified error that was found by the connection test.
Example
GLOBAL ConnTest()(INT result) INT i, timestamp; STRING error; FILE logFile; result := CONNTEST(CONNTEST_DEBUG_NORMAL); // Write connection test errors to a CSV file IF (result > 0) THEN logFile := FOPEN("conntest.csv", "a"); IF FERROR() THEN PRINT("Error writing to log file\n"); EXIT; END; timestamp := NOW(); FOR i := 0 FOR result error := CONNTEST_RESULT(i); FWRITE(logFile, FORMAT(timestamp, "{Date} {Time}")); FWRITE(logFile, ","); FWRITE(logFile, SERIAL_NUMBER); FWRITE(logFile, ","); FWRITE(logFile, i+1); FWRITE(logFile, ","); FWRITE(logFile, error); END; FCLOSE(logFile); END; END;
XJTAG v4.1.100