TXLSCellType Enumerated Values

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
HMArnold
Posts: 5
Joined: Mon Apr 15, 2013 5:32 pm

TXLSCellType Enumerated Values

Post 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
jleg
Posts: 11
Joined: Thu Apr 04, 2013 12:04 pm
Location: France

Re: TXLSCellType Enumerated Values

Post 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.
                     );
HMArnold
Posts: 5
Joined: Mon Apr 15, 2013 5:32 pm

Re: TXLSCellType Enumerated Values

Post by HMArnold »

Thanks very much

I thought I had tried that first, but I guess I still had the USES entries wrong
HMArnold
Posts: 5
Joined: Mon Apr 15, 2013 5:32 pm

Re: TXLSCellType Enumerated Values

Post 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
jleg
Posts: 11
Joined: Thu Apr 04, 2013 12:04 pm
Location: France

Re: TXLSCellType Enumerated Values

Post by jleg »

I found the definition of TXSLCellType in the Xc12Utils5 unit in the SrcXLS directory.
HMArnold
Posts: 5
Joined: Mon Apr 15, 2013 5:32 pm

Re: TXLSCellType Enumerated Values

Post by HMArnold »

Thanks

I see now that ctInteger has gone away
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: TXLSCellType Enumerated Values

Post by larsa »

Hello

The ctInteger value was removed as there are no integer cells in excel.
Lars Arvidsson, Axolot Data
Post Reply