Recent

Author Topic: Issues Running TPSScript on x64 in Lazarus 3.8  (Read 1430 times)

lhl

  • New Member
  • *
  • Posts: 10
Issues Running TPSScript on x64 in Lazarus 3.8
« on: March 30, 2025, 11:50:13 pm »
I'm using TPSScript, and the code below works correctly on x86. However, when I compile it in x64, it doesn't run. Does anyone know why? 
I'm using Lazarus 3.8 64x.

My Script:
Code: Pascal  [Select][+][-]
  1. procedure fechar(Sender: TObject; var CloseAction: TCloseAction);
  2. begin
  3.    Showmessage( 'Vou fechar' );
  4. end;
  5.  
  6. procedure exec;
  7. var F: TForm;
  8. begin
  9.    F :=  TForm.Create(NIL);
  10.    try
  11.       F.OnClose := @fechar;
  12.       F.ShowModal;
  13.    finally
  14.       F.Free;
  15.    end;
  16. end;  
« Last Edit: April 02, 2025, 07:29:42 pm by lhl »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12429
  • Debugger - SynEdit - and more
    • wiki
Re: Issues Running TPSScript on x64 in Lazarus 3.8
« Reply #1 on: January 04, 2026, 03:41:07 pm »
I saw https://forum.lazarus.freepascal.org/index.php/topic,71170.msg573513.html#msg573513

Unfortunately I don't know the answer.

I also don't know if your event method (the code to be called) is
- in pascal script
- in the compiled exe, but to be called by the script
?

In any case, I know some case are not implemented, search the source for:
(at least I think that is the related part / needs to be double checked)
Code: Pascal  [Select][+][-]
  1. {$ifdef fpc}
  2.   {$if defined(cpu86)}         // Has MyAllMethodsHandler
  3.   {$else}
  4.   // {$if defined(cpupowerpc) or defined(cpuarm) or defined(cpu64)}
  5.     {$define empty_methods_handler}
  6.   {$ifend}
  7. {$endif}
  8.  

I don't know what the planned solution for that is.

IIRC (but rather like a faint memory) there was talk about using RTTI calling... Not sure, I think that requires fpc 3.3.1 and depending on OS also some external library (dll/so). But I may be mixing that up.

---
In any case, the version of Pascalscript included in Lazarus is primarily for supporting editor-macros in the IDE.

It will occasionally be updated, but for your own projects you may still need to download from the original side if you require up-to-date fixes.

 

TinyPortal © 2005-2018