× Components and Libraries for Scripting Development, discussions, problems and suggestions

Question Compiler broken for array datatypes

  • universe
  • universe's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
4 years 8 months ago #8559 by universe
Compiler broken for array datatypes was created by universe
Hello,
I've just noticed that Pascal Script engine is no more able to read arrays in version CT5.5, last tested in CT4.7 were it was working out of the box.
Thanks.

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

  • universe
  • universe's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
4 years 8 months ago #8560 by universe
Replied by universe on topic Compiler broken for array datatypes
I've just prepared this sample project to verify the bug

File Attachment:

File Name: testapp.zip
File Size:48 KB
Attachments:

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

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 years 8 months ago #8563 by Sternas Stefanos
Replied by Sternas Stefanos on topic Compiler broken for array datatypes
Thanks Sir
we will test and report

PilotLogic Architect and Core Programmer
The following user(s) said Thank You: universe

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

  • universe
  • universe's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
4 years 8 months ago - 4 years 8 months ago #8572 by universe
Replied by universe on topic Compiler broken for array datatypes
Thanks, I think I found another bug, maybe they are related, the sample project attached on CT5.5 raises exception at function test2.
By the way I replaced the pl_PascalScript of CT5.5 by the same in CT4.7 but the problem remains, do I have to rebuild the IDE, or the bug is in FPC itself?

File Attachment:

File Name: testapp.7z
File Size:8 KB
Attachments:
Last edit: 4 years 8 months ago by universe. Reason: grammar :)

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

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 years 8 months ago #8573 by Sternas Stefanos
Replied by Sternas Stefanos on topic Compiler broken for array datatypes
Sir
we want more time for testing... :)

PilotLogic Architect and Core Programmer

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

  • universe
  • universe's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
4 years 8 months ago #8574 by universe
Replied by universe on topic Compiler broken for array datatypes
Ok sorry :)

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

  • universe
  • universe's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
4 years 7 months ago #8710 by universe
Replied by universe on topic Compiler broken for array datatypes
The bug still exists in the latest CT5.6 build

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

  • universe
  • universe's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
4 years 7 months ago #8734 by universe
Replied by universe on topic Compiler broken for array datatypes

Sternas Stefanos wrote: Sir
we want more time for testing... :)


The problem still exists in the latest release 5.6

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

  • universe
  • universe's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
4 years 7 months ago #8735 by universe
Replied by universe on topic Compiler broken for array datatypes
Any feedback about this? Do I have to stay with CT4.7!!!

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

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 years 7 months ago - 4 years 7 months ago #8736 by Sternas Stefanos
Replied by Sternas Stefanos on topic Compiler broken for array datatypes
Sir we test pl_PascalScript
with CodeOcean small IDE sample
C:\codetyphon\CodeOcean\PascalScript\samples\a_small_ide

and we don't find any problem with test scripts
C:\codetyphon\CodeOcean\PascalScript\samples\a_small_ide\scripts

We don't know the "logic" of your app
CT 4.7 it's to old version

PilotLogic Architect and Core Programmer
Last edit: 4 years 7 months ago by Sternas Stefanos.

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

  • universe
  • universe's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
4 years 7 months ago #8737 by universe
Replied by universe on topic Compiler broken for array datatypes
There's nothing strange in the logic of my application, declaring custom array types and then calling them, something was broken and sure there will be other complaints for advanced projects in the future if it won't be fixed. The problem is the compiler, I'll try to test with the latest lazarus release with FPC 3.0 and report back.

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

  • universe
  • universe's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
4 years 7 months ago #8738 by universe
Replied by universe on topic Compiler broken for array datatypes
There is no access violation and the message window is shown with Lazarus 1.6 and FPC3.0, but values are wrong and program enters infinite loop (Length of vector not working), as I guessed it's a compiler problem.

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

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 years 7 months ago - 4 years 7 months ago #8739 by Sternas Stefanos
Replied by Sternas Stefanos on topic Compiler broken for array datatypes
Sir
a) my opinion and our lab test show
that CT-FPC is more stable from FPC 3.0

b) please make a script to test with
C:\codetyphon\CodeOcean\PascalScript\samples\a_small_ide

like this
Program IFSTest;
type
  TArrayOfString = array of String;

procedure Test(x: TArrayOfString);
var
  i: integer;
begin
  for i := 0 to Getarraylength(X) -1 do
  begin
     writeln(x[i]);
  end;
end;
var
  temp: TArrayOfString;

Begin
  setarraylength(temp, 2);
  temp[0] := 'Test1';
  temp[1] := 'Test2';
  test(temp);
End.

this sample work OK on 8 OSes

PilotLogic Architect and Core Programmer
Last edit: 4 years 7 months ago by Sternas Stefanos.

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

  • universe
  • universe's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
4 years 7 months ago #8740 by universe
Replied by universe on topic Compiler broken for array datatypes
Thanks for your suggestion, I'll test and report, meanwhile I reported to the lazarus forum and maybe I'll report to FPC.

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

  • universe
  • universe's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
4 years 7 months ago #8741 by universe
Replied by universe on topic Compiler broken for array datatypes
Well, the way you suggested the script will be too big (with my real program) and I want to keep things simple in the script, so I need to hide some parts and make function calls as I did, anyway thanks for the point.

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

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 years 7 months ago - 4 years 7 months ago #8742 by Sternas Stefanos
Replied by Sternas Stefanos on topic Compiler broken for array datatypes
Finally array types work for you in CT 5.6?
I can post screens from any OS you like.

PilotLogic Architect and Core Programmer
Last edit: 4 years 7 months ago by Sternas Stefanos.

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

  • universe
  • universe's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
4 years 7 months ago #8743 by universe
Replied by universe on topic Compiler broken for array datatypes
The script you provided earlier works fine, but I can't use it as it will make the script too big in the real program.

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

  • universe
  • universe's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
4 years 7 months ago #8744 by universe
Replied by universe on topic Compiler broken for array datatypes
After doing a lot of tests I found the bug exits only in Lazarus 64 bit versions, and the program works as expected with Lazarus 1.4 x86 with FPC 2.6.2 and with Lazarus 1.6RC1 with FPC 3.0.

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

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 years 7 months ago #8745 by Sternas Stefanos
Replied by Sternas Stefanos on topic Compiler broken for array datatypes
Yes Sir
but here is not Lazarus Forum...

PilotLogic Architect and Core Programmer

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

  • universe
  • universe's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
4 years 7 months ago #8746 by universe
Replied by universe on topic Compiler broken for array datatypes
Sure, I wanted to give you some guides for comparison, as it could give you some hints if the bug is only in Lazarus 64bit version while with CT is in the 32 bit version (I didn't test the 64bit yet), I talk Object Pascal at last.

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