Closed luizluvizutto closed 4 years ago
? of object ? TEvento = procedure( txt: String ) of object;
...
procedure SIRegister_TClassEvento(CL: TPSPascalCompiler);
begin
CL.AddTypeS('TEvento', 'procedure( txt: String )');
with CL.AddClassN(CL.FindClass('TComponent'),'TClassEvento') do
begin
RegisterProperty('Evento', 'TEvento', iptrw);
...
I made the change and the same problem.
I have no problems. Not enough information to analyze. Need a complete example, IDE version...
Hello, I'm using Delphi 10.3 Community Edition Follow the link of the example I set up: https://github.com/luizluvizutto/TstPascalScript
Working fine when correct your code:
Un_Evento.pas
TEvento = procedure( txt: String ) of object; // changed declaration to method
Un_Principal.pas
TFrmPrincipal = class(TForm)
...
procedure ProcedureDoEvento( txt: String ); // move to method
end;
.,.
procedure TFrmPrincipal.ProcedureDoEvento( txt: String ); // implement as method
..
My problem is in the Script.
Perhaps I am not able to explain my problem correctly, because my English is weak.
When I run "Run script" nothing happens.
In this link I uploaded an exe of this example. If you click on "Run Script" the ABC method is not triggered. https://www.dropbox.com/sh/840au9t57xinvgs/AADxE1yfrlrx8aULBl_RVBtSa?dl=0
@pult thanks for the concern brother.
I cloned your sources and tested it. Did not work. Clicking the "Executar Script" button nothing happens.
Send me your compiled executable for testing.
binary (xe3, dx10.3, dx10.4 x86, x64 ) and full sources with thirdparty... TstPascalScript-pult-full_v2020.0605.0217.7z
Hello friend, it looks like I'm getting close to the solution!
Your executables worked!
I replaced the "rps" fonts in my source "... \ pascalscript \ Source" and recompiled my system and it worked!
Now my question was, what is different about your sources that you don't have in the main repository?
Or rather, what are the sources with the thirdparty? I think my problem is there.
And again, thanks for the help!
Hello Friend! Well, first I want to congratulate you on the fork of remobjects and, above all, to make something that I think is very important for Script work. Only I had some doubts. I even apologize for meddling. Wouldn't these adjustments make it legal for RemObjects to implement their sources?
No. The standard(lelag) version RemObj should also work fine. Problems are possible in the latest versions of Delphi and the incomplete implementation of "InvokeCall.inc". I'm just disabling its use.
hi,
how you solve the problem ? i had same problem , can describe it ? i don't understand from the reading.
thanks
Hello friends! I'm having difficulty running an event in PascalScript. In this example, I have a "type" and a "class".
With TEvento and TClassEvento registered in Pascal Script, as shown below:
Comments: I saw in some grammars that you need to add the "@"
O.Evento: = @ABC;
when using PascalScript and does not work. When I try to run without the "@" I get the return: [Error] (10:22): Invalid number of parametersThe link contains the example I set up.
Sorry for my English, I'm from Brazil and my sincere thanks.