Welcome, Guest
Username: Password: Remember me
Discussions for CodeTyphon Studio Installation and Setup.
  • Page:
  • 1

TOPIC:

How can I swap fpc 2.7.1 to stable 2.6.0 ? 11 years 10 months ago #2144

  • Mikolaj
  • Mikolaj's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 0
I have a question about different versions of FPC.
Can anyone show me, how to swap fpc 2.7.1 in CT 2.70 to stable version 2.6.0?

PS. Sorry for my bad English.

Please Log in or Create an account to join the conversation.

Re: How can I swap fpc 2.7.1 to stable 2.6.0 ? 11 years 10 months ago #2146

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
Sir
this is not possible
FPC 2.6.0 has a lot of differences from FPC 2.7.1
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Re: How can I swap fpc 2.7.1 to stable 2.6.0 ? 11 years 10 months ago #2147

  • Mikolaj
  • Mikolaj's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 0
Thank You Sir for the response.
I've asked for it, because I have some issues with this version (2.7.1) of FPC.

When i try cast PChar to String I get blank value. For example:

function Foo1(): PChar;
var
rep: String = '';
i: Byte = 0;
begin
for i:=34 to 40 do begin
rep:= Char(i) + rep;
end;
Result:=PChar(rep);
end;

procedure Foo2;
var
val1: PChar;
val2: String;
begin
val1:= Foo1(); //Debug shows that val1 has assigned value;
val2: String(val1); // I get a blank value of val2. The earlier version of FPC assigned the value correctly.
end;

Is there any options to fix it up or it's a compiler bug?

Please Log in or Create an account to join the conversation.

Re: How can I swap fpc 2.7.1 to stable 2.6.0 ? 11 years 10 months ago #2180

  • Keith Johnson
  • Keith Johnson's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0
Your Foo1 function shouldn't work in the first place..

You can't cast a string from a function to a pchar, as the string reference count will just zero out as soon as the function returns.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1