Hi
Could someone help me a bit? I have to translate a C++ function call to PB and I'm getting stuck.
The C++ is this:
extern EXPORTQUAL CHECKER_RC check(const char* checkTxt, CHECKRESULT &res,
int &noOfResults,
char results[RESULTSSIZE][RESULTSBUFSIZE], char* info);
This is part of the example code I received, on how to call this function:
I've tried this (and many more variations) but I'm missing somehting. Is the results array a 2 dimensional thing?
Hope someone can help
Thanx
Jeroen
Just be to complete: below are the types and constants.
// linguistic return codes
typedef int CHECKRESULT;
const CHECKRESULT CHECK_OK = 10;
const CHECKRESULT CHECK_AMBIGUOUS = 20;
const CHECKRESULT CHECK_ERROR = 30;
const CHECKRESULT CHECK_UNKNOWN = 40;
// return codes for initialize/terminate
typedef int CHECKER_RC;
const CHECKER_RC CRC_OK = 0;
const CHECKER_RC CRC_FAIL_null_parameter = 1;
const CHECKER_RC CRC_FAIL_parameter_value = 2;
const CHECKER_RC CRC_FAIL_parameter_size = 3;
const CHECKER_RC CRC_FAIL_no_logfile = 10;
const CHECKER_RC CRC_FAIL_cant_write_logfile = 11;
const CHECKER_RC CRC_FAIL_no_resource = 20;
const CHECKER_RC CRC_FAIL_cant_read_resource = 21;
const CHECKER_RC CRC_FAIL_cant_write_resource = 22;
const CHECKER_RC CRC_FAIL_resource_error = 23;
const CHECKER_RC CRC_FAIL_no_library = 30;
const CHECKER_RC CRC_FAIL_cant_open_library = 31;
const CHECKER_RC CRC_FAIL_library_error = 32;
const CHECKER_RC CRC_FAIL = 40;
const CHECKER_RC CRC_FAIL_uninitialized = 41;
const CHECKER_RC CRC_FAIL_previous_error = 42;
const CHECKER_RC CRC_FAIL_out_of_memory = 43;
const CHECKER_RC CRC_FAIL_exception = 44;
// fixed size of results array
const int RESULTSSIZE = 10;
const int RESULTSBUFSIZE = 100; //maximum word length for words in the results buffer
const int INFOBUFSIZE = 10000; //maximum number of characters in info buffer
------------------
Could someone help me a bit? I have to translate a C++ function call to PB and I'm getting stuck.
The C++ is this:
extern EXPORTQUAL CHECKER_RC check(const char* checkTxt, CHECKRESULT &res,
int &noOfResults,
char results[RESULTSSIZE][RESULTSBUFSIZE], char* info);
This is part of the example code I received, on how to call this function:
Code:
int checkres = 0; int noOfRes = 0; // results (suggestions) will be put in this array of arrays char results[RESULTSSIZE][RESULTSBUFSIZE]; // extra information will be put in this array char info[INFOBUFSIZE]; int checkret = check(buf.c_str(), checkres, noOfRes, results, info);
I've tried this (and many more variations) but I'm missing somehting. Is the results array a 2 dimensional thing?
Code:
LOCAL checkTxt AS ASCIIZ * 100 DIM results(%RESULTSSIZE, %RESULTSBUFSIZE) AS LOCAL ASCIIZ * 256 DIM info(%INFOBUFSIZE) AS LOCAL ASCIIZ * 256 checkTxt = "factuur" lResult = CHECK( checkTxt , %checkres, %noOfRes, results() , info() )
Hope someone can help
Thanx
Jeroen
Just be to complete: below are the types and constants.
// linguistic return codes
typedef int CHECKRESULT;
const CHECKRESULT CHECK_OK = 10;
const CHECKRESULT CHECK_AMBIGUOUS = 20;
const CHECKRESULT CHECK_ERROR = 30;
const CHECKRESULT CHECK_UNKNOWN = 40;
// return codes for initialize/terminate
typedef int CHECKER_RC;
const CHECKER_RC CRC_OK = 0;
const CHECKER_RC CRC_FAIL_null_parameter = 1;
const CHECKER_RC CRC_FAIL_parameter_value = 2;
const CHECKER_RC CRC_FAIL_parameter_size = 3;
const CHECKER_RC CRC_FAIL_no_logfile = 10;
const CHECKER_RC CRC_FAIL_cant_write_logfile = 11;
const CHECKER_RC CRC_FAIL_no_resource = 20;
const CHECKER_RC CRC_FAIL_cant_read_resource = 21;
const CHECKER_RC CRC_FAIL_cant_write_resource = 22;
const CHECKER_RC CRC_FAIL_resource_error = 23;
const CHECKER_RC CRC_FAIL_no_library = 30;
const CHECKER_RC CRC_FAIL_cant_open_library = 31;
const CHECKER_RC CRC_FAIL_library_error = 32;
const CHECKER_RC CRC_FAIL = 40;
const CHECKER_RC CRC_FAIL_uninitialized = 41;
const CHECKER_RC CRC_FAIL_previous_error = 42;
const CHECKER_RC CRC_FAIL_out_of_memory = 43;
const CHECKER_RC CRC_FAIL_exception = 44;
// fixed size of results array
const int RESULTSSIZE = 10;
const int RESULTSBUFSIZE = 100; //maximum word length for words in the results buffer
const int INFOBUFSIZE = 10000; //maximum number of characters in info buffer
------------------
Comment