Page 1 of 1

TXLSCellType Enumerated Values

Posted: Mon Apr 15, 2013 5:39 pm
by HMArnold
I see that TCellType has changed to TXLSCellType, but I can't find what the enumerated cell types have changed to.

Here is an example of XLRReadWriteII4 code that worked:

case PXLS.Sheets[PSheet].CellType[PCol,PRow] of
ctInteger : XLSCellInt := PXLS.Sheets[PSheet].AsInteger[PCol,PRow];
ctFloat, ctNumberFormula : XLSCellInt := Round(PXLS.Sheets[PSheet].AsFloat[PCol,PRow]);
ctString : begin
Val (PXLS.Sheets[PSheet].AsString[PCol,PRow],Nmbr,Stat);
if Stat = 0 then XLSCellInt := Nmbr else XLSCellInt := 0;
end;
else XLSCellInt := 0;
end;

Now all the case options fail (ctInteger, ctFloat, etc)

I have looked in the sample provided, and I can't see where if shows reading or changing the data type for contents of a cell.

Is there anywhere I can look to find the new cell types or is there an example of reading/changing cell types anywhere?

Thanks

Re: TXLSCellType Enumerated Values

Posted: Tue Apr 16, 2013 7:24 am
by jleg
Hello,

I had the same problem, the definition of the TXLSCellType has changed. So, just add 'x' as prefix.
See definition below.

Code: Select all

type TXLSCellType = (xctNone,               //* Undefined cell.
                     xctBlank,              //* Blank cell.
                     xctBoolean,            //* Boolean cell.
                     xctError,              //* Cell with an error value.
                     xctString,             //* String cell (index into SST).
                     xctFloat,              //* Floating point cell.
                     xctFloatFormula,       //* Formula cell where the result of the formula is a numeric value.
                     xctStringFormula,      //* Formula cell where the result of the formula is a string value.
                     xctBooleanFormula,     //* Formula cell where the result of the formula is a boolean value.
                     xctErrorFormula        //* Formula cell where the result of the formula is an error value.
                     );

Re: TXLSCellType Enumerated Values

Posted: Tue Apr 16, 2013 9:40 am
by HMArnold
Thanks very much

I thought I had tried that first, but I guess I still had the USES entries wrong

Re: TXLSCellType Enumerated Values

Posted: Tue Apr 16, 2013 9:55 am
by HMArnold
When I compile with the leading "x", I still get a compile error using all the modules defined in the CELL FORMAT sample

Are the changed definitions defined somewhere in V5? If so what module?

CTINTEGER never occurs in the XLSSRC folder with or without an "x"

If they are not already defined, where did you find the list in your response? Are you sure that is the complete list and they are in the right order?

Having any of those definitions wrong would be a difficult problem to isolate once the program used.

Also, how did you find the changed definitions?

Thanks again

Re: TXLSCellType Enumerated Values

Posted: Tue Apr 16, 2013 10:06 am
by jleg
I found the definition of TXSLCellType in the Xc12Utils5 unit in the SrcXLS directory.

Re: TXLSCellType Enumerated Values

Posted: Tue Apr 16, 2013 10:07 am
by HMArnold
Thanks

I see now that ctInteger has gone away

Re: TXLSCellType Enumerated Values

Posted: Wed Apr 17, 2013 7:51 am
by larsa
Hello

The ctInteger value was removed as there are no integer cells in excel.