#26 fpspreadsheet patch

v1.0 (example)
open
nobody
5
2014-02-19
2014-02-19
serzh
No

patch for function TsWorksheet.CellPosToText from fpspreadsheet.pas

class function TsWorksheet.CellPosToText(ARow, ACol: Cardinal): string;
var
lStr: string;
begin
lStr := '';
inc(ACol);
while ACol > 0 do begin
lStr := Char(ACol mod 26 + 64) + lStr;
ACol := ACol div 26;
end;
Result := Format('%s%d', [lStr, ARow+1]);
end;

Example,
for CellPosToText(0,0) result "A1"
for CellPosToText(1,1) result "B2"
for CellPosToText(2,26) result "AA3"
for CellPosToText(3,100) result "CW4"
for CellPosToText(4,1000) result "ALM5"

Discussion