I have been calculating molecule properties in JChem/Excel using both JChemExcel.Functions e.g. JCAliphaticRingCount(A1), and Chemical Terms e.g. JCChemicalTerms(A1,"matchCount('n')").
It appears that the former method returns numerical values that Excel recognises as numbers, whereas the latter returns numerical values that Excel recognises as text.
Although it is possible to convert the text results into numbers in Excel, is there a way to return JCChemicalTerms values that are correctly perceived as numbers?
Tim Ritchie (GlaxoSmithKline UK).
I checked the COM interface that JChemExcel exposes for the Excel host, and the interface is okay. It returns and handles VARIANT (object) which can be any type theoretically.
The problem is that our underlying library returns not primitive types but reference types .NET does NOT handle them automatocally as primitve data types (like int <> java.lang.Integer). Which means that when it is auto converted the toString method is automatically called on these reference types.
The workaround you can use is to embed this into a cast function of Excel:
I had used the INT command in Excel to convert the 'string' calculation into a number, but I didn't realise that one can include this in the actual JC formula.