View Full Version : Phoenix with Delphi 6.
Bones
26-09-2007, 05:55 PM
Hi .
I was trying to compile a Phoenix package for delphi 6.
The first problem I ran into was that the function 'PosEx' does not seem to exist in D6, I have BDS2006 too , and could probrably use the, but I was hoping to get it working in D6 ..
Any ideas ?
loriendesign
26-09-2007, 11:18 PM
http://www.pascalgamedevelopment.com/viewtopic.php?t=4750&postdays=0&postorder=asc&start=15
In phxLogger.pas starting at line 315 it should read:
{$IFDEF FPC}
{$IFDEF VER1}
WriteLn(FLogFile, ' <compiler>Free Pascal 1.x.x</compiler>');
{$ELSIF VER1_0}
WriteLn(FLogFile, ' <compiler>Free Pascal 1.x.x</compiler>');
{$ELSE}
WriteLn(FLogFile, ' <compiler>Free Pascal</compiler>');
{$ENDIF}
{$ELSE}
{$IFDEF VER180}
WriteLn(FLogFile, ' <compiler>Delphi 2006</compiler>');
{$ELSEIF VER170}
WriteLn(FLogFile, ' <compiler>Delphi 2006</compiler>');
{$ELSEIF VER160}
WriteLn(FLogFile, ' <compiler>Delphi 8</compiler>');
{$ELSEIF VER150}
WriteLn(FLogFile, ' <compiler>Delphi 7</compiler>');
{$ELSEIF VER140}
WriteLn(FLogFile, ' <compiler>Delphi 6</compiler>');
{$ELSEIF VER130}
WriteLn(FLogFile, ' <compiler>Delphi 5</compiler>');
{$ELSE}
WriteLn(FLogFile, ' <compiler>Delphi</compiler>');
{$IFEND}
{$ENDIF}
Andreaz
27-09-2007, 05:53 AM
PosEx is defined as
function PosEx(const SubStr, S: string; Offset: Cardinal = 1): Integer;
var
I,X: Integer;
Len, LenSubStr: Integer;
begin
if Offset = 1 then
Result := Pos(SubStr, S)
else
begin
I := Offset;
LenSubStr := Length(SubStr);
Len := Length(S) - LenSubStr + 1;
while I <= Len do
begin
if S[I] = SubStr[1] then
begin
X := 1;
while (X < LenSubStr) and (S[I + X] = SubStr[X + 1]) do
Inc(X);
if (X = LenSubStr) then
begin
Result := I;
exit;
end;
end;
Inc(I);
end;
Result := 0;
end;
end;
in delphi 7, it search for a string in a string with a start offset.
Bones
27-09-2007, 06:48 AM
PosEx is defined as
function PosEx(const SubStr, S: string; Offset: Cardinal = 1): Integer;
var
I,X: Integer;
Len, LenSubStr: Integer;
begin
if Offset = 1 then
Result := Pos(SubStr, S)
else
begin
I := Offset;
LenSubStr := Length(SubStr);
Len := Length(S) - LenSubStr + 1;
while I <= Len do
begin
if S[I] = SubStr[1] then
begin
X := 1;
while (X < LenSubStr) and (S[I + X] = SubStr[X + 1]) do
Inc(X);
if (X = LenSubStr) then
begin
Result := I;
exit;
end;
end;
Inc(I);
end;
Result := 0;
end;
end;
in delphi 7, it search for a string in a string with a start offset.
Excellent..
I couldn't find the source for that anywhere, I'll include it in my dclUser package . thanks andreaz
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.