I might be the last guy on the planet relying on B-Tree Filer but I made the jump from Delphi 2007 to XE2.
After getting over all the AnsiChar and PAnsiChar issues, the code now crashes with a Range Check with zero items on a page.
Is anyone successfully running B-Tree Filer under Delphi XE2? If so, how'd ya do it? :)
Update Range check error here:
procedure IsamUnPack(var Page : IsamPage; KeyL : Word);
var
I, K, S : Word;
P : Array [0..0] Of Byte absolute Page; {Real bounds [0..65535]}
begin
K := KeyL + 9;
S := Pred (Page.ItemsOnPage) * K + 6;
if KeyL <> MaxKeyLen then begin
for I := Page.ItemsOnPage downto 2 do begin
Move(P[S], Page.ItemArray[I], K); // Range Check error in Warren P's suggestion
S := S - K;
end;
end;
end;
While Page.ItemsOnPage should never be zero (the Range Check error is valid here) it may have been caused by data alignment issues. This code, added to BTDEFINE.INC seems to be doing the trick...
{$IFDEF VER230}
{$DEFINE UsingDelphi}
{$ENDIF}
{$IFDEF VER230} {Delphi XE2}
{$A-} {align data on byte boundaries}
{$B-} {short circuit boolean evaluation}
{$H+} {long string support}
{$I-} {suppress I/O checking}
{$J+} {writeable typed constants}
{$P-} {do not allow open string parameters}
{$Q-} {overflow checking off}
{$R-} {range checking off}
{$T-} {no type checked pointers with @}
{$V-} {no var string checking}
{$X+} {extended syntax on}
{$DEFINE Delphi2006}
{$DEFINE Delphi1Plus}
{$DEFINE Delphi2Plus}
{$DEFINE Delphi3Plus}
{$DEFINE Delphi4Plus}
{$DEFINE Delphi5Plus}
{$DEFINE Delphi6Plus}
{$DEFINE Delphi7Plus}
{$DEFINE Delphi2005Plus}
{$DEFINE Delphi2006Plus}
{$ENDIF}