[fpc-pascal] Suggestions for fpspreadsheet

Graeme Geldenhuys graemeg.lists at gmail.com
Thu Jan 29 13:59:32 CET 2009

On Thu, Jan 29, 2009 at 2:25 PM, Felipe Monteiro de Carvalho
> A doubt I am facing now is if rows and column numbers should start at
> 1 like what is seen in most spreadsheet user interfaces or in zero
> ..... It was zero before, but now I am changing it to 1, althougth I
> am still not sure of the best option ... ideas?

hehehe... I went through that same process in fpGUI's grid components
(and other list components like listbox etc.).  I made all components
1-based as that seemed logical to me. You start counting from 1, the
1st item has the number 1 etc...  After a few months and confusing the
sh*t out of many developers, I switched back to 0-based counting.

Part of the confusion was what developers were used to in Delphi. Plus
many (all) container classes in the RTL use 0-based counting. It
becomes quite a chore to keep track of 1-based counting in the grid
and when that data is stored internally in some RTL container class,
to switch to 0-based counting.

So purely for the sake of simplicity (and saving yourself a lot of
grey hair), I would recommend you follow the crowd and go with 0-based

  - Graeme -

fpGUI - a cross-platform Free Pascal GUI toolkit

More information about the fpc-pascal mailing list