{$MODE OBJFPC} { -*- delphi -*- } {$INCLUDE blank.inc} {$CODEPAGE UTF8} unit unit1; interface uses unit2; type TTest1 = packed record case Byte of 0: (Length: Byte; case Byte of 0: (Byte1, Byte2, Byte3, Byte4: Byte)); 1: (AsString: String[1]); end; function Test2A(const Param1: Pointer; const Param2: Integer; out Param3: Byte): TTest2; function Test2B(const Param1: TTest2): TTest1; implementation uses unit3; function IntToStr(const Param1: Integer): AnsiString; begin end; operator := (const Param1: TTest1): UTF8String; begin end; operator + (const Op1: TTest1; const Op2: UTF8String): UTF8String; begin end; operator + (const Op1: UTF8String; const Op2: TTest1): UTF8String; begin Writeln(Op1 + Op1); end; operator + (const Op1, Op2: TTest1): UTF8String; begin end; function IsValidUTF8(const Param1: RawByteString): Boolean; begin Result := True; end; function Test2A(const Param1: PByte; out Param3: Byte): TTest2; procedure Return(const Param1: TTest2; const Param2: Integer); inline; begin Result := 0; Param3 := Param2; end; begin case Param1^ of 1: if (Param1^ in [0]) then begin if (Param1^ in [1..2]) then begin Return(0, 0); end; end else Return(0, 0); end; Writeln('A'); Writeln('B'); Writeln(Result.Field1 < 0); end; function Test2A(const Param1: Pointer; const Param2: Integer; out Param3: Byte): TTest2; begin end; function Test2B(const Param1: TTest2): TTest1; begin Writeln(''); Writeln('A'); Writeln('B'); Writeln('C' + IntToStr(0)); end; function Test2C(const Param1: TTest2): Byte; begin end; function Test2D(const Param1: PByte): Byte; begin end; function Test2E(const Param1: Pointer; const Param2: Integer): Byte; begin end; procedure Test2F(); var S: UTF8String; Dummy1: Byte; Index: Integer; begin Writeln(Test2A(PByte(@S[1]), Dummy1) = 0); Writeln(Dummy1 = 1); Writeln(Test2A(PByte(@S[Index]), Dummy1) = 0); Writeln(Dummy1 = 1); Inc(Index, Dummy1); Writeln(Test2A(PByte(@S[Index]), Dummy1) = 0); Writeln(Dummy1 = 1); Inc(Index, Dummy1); Writeln(Test2A(PByte(@S[Index]), Dummy1) = 0); Writeln(Dummy1 = 1); Inc(Index, Dummy1); Writeln(Test2A(PByte(@S[Index]), Dummy1) = 0); Writeln(Dummy1 = 1); end; end.