Question : one code fits all :  INDY9 or INDY 10 with D7 or D2005 or D2010Question:

will such a simple upgrade / compability phrase work  for TIdTCPClient ????

OIHandler.WriteBuffer (....)  did not work as a part of the new code


1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
TIndyEXTClass = Class(  {$IFDEF VER210}  ?????  //  Delphi 2010 indy 10    {$else} TIdTCPClient  //  D7 INDY 9  {$endif}  )

      function DoSomething ( .....  ): Boolean;

end;


function TIndyEXTClass.DoSomething ( .....  ): Boolean;
var  ftmpStream  : TFileStream;

begin




     if Connected then
              begin
                 try
                  begin
                    //  ->  UnderStand Command ??
                    WriteBuffer(MyData, Sizeof(MyData),true);
                    ReadBuffer(MyData, Sizeof(MyData));

Answer : one code fits all :  INDY9 or INDY 10 with D7 or D2005 or D2010Question:

Random Solutions  
 
programming4us programming4us