Jump to content

TMS Scripter


herculanojs
 Share

Recommended Posts

Is anyone successfully using TMS Scripter with Unigui?

I have approximately 80% of codes working properly, and some things still have problems.

 

Conform a previous post, it would be very interesting if we got a satisfactory interaction with TMS Scripter or some other pascal code interpreter, so we could have a more dynamic application possible.

 

Good the problems that I face:

a) In form creation, if it contains the property freeonclose as true, I get exception when closing the form: "There is no Default JavaScript Object "

B) In the clientEvents assignment: the added codes are not executed

 

 

Someone would know or could tell me some solution to these cases, or know some pascal code interpreter that works perfectly with unigui.

scRelacaoPessoa_Produto.txt

post-1670-0-10082000-1505329672_thumb.jpg

Link to comment
Share on other sites

Hello Herculanojs,

 

Take a look at http://paxcompiler.com/. It is actively in development. I think it is free but I haven't read their licensing module.

If it's licensing model fits and works with UniGUI, then it should be in UniGUI by default like UniSynaxEditor. 

 

One of my friends has used it in his project and praised it.

 

 

According to their website:

 

About paxCompiler

paxCompiler is an embeddable cross-platform compiler of the Object Pascal, Basic and JavaScript programming languages. The key features of the paxCompiler are:

  • The compiler generates machine code for Intel compatible processors (IA-32/64 architecture) for platforms: Win32/Win64, Mac OS, iOS Simulator.
  • The second script runner is a cross-platform interpreter based on intermediate code. Supported platforms are Win32/Win64, Linux, Android, Mac OS, iOS Simulator, iOS Device.
  • The compiler is written in Delphi and it is compatible with Free Pascal/Lazarus 32/64 bit.
  • It is possible to use the compiler as a scripting engine, so you can customize and extend the application without having to recompile it.
  • The compiler supports Object Pascal language based on the Delphi 7 standard and extends it with generic types, operator overloading, anonymous functions and closures, lambda-expressions. Syntax of Basic language is similar to VB.NET. JavaScript implementation is based on ECMA-262 standard.
  • Cross-language programming support. You can use Pascal units in Basic and JavaScript programs and vice versa.
  • COM support.
  • paxCompiler components allow you to implement debugger and code explorer.
  • Script-defined types support run-time information (RTTI).
  • You can bind instances of script-defined classes with dfm files.
  • You can import host-defined types with paxCompiler importer. Automatic import of host-defined types is available for Delphi XE2-XE7.
  • You can create stand alone executable files and dlls.
  • Support of compiled units and run-time packages.
  • paxCompiler engine is thread safe.
  • The nearest milestones on road map of the compiler development include: C/C++ compiler and native code generator for ARM processors

 

Regards

Link to comment
Share on other sites

  • 2 weeks later...
Unfortunately I did not get any satisfactory tests.

For some reason, I still could not concentrate on that. Even following some examples of pax, nothing seems to happen.

I have not tested it yet in the desktop environment, to check if it is something related to the web environment.

Link to comment
Share on other sites

Here you go  :)

 

Add PaxCompiler, PaxPascalLanguage and PaxInterpreter to UniForm.

Add UniButton16 to UniForm

Add UniMemo2 to UniForm

 

Contents of UniMemo2:

begin
  UniButton16.Caption := 'Greets to Farshad';
end.
 

 

procedure TMainForm.UniButton16Click(Sender: TObject);
var
  I, H_TButton: Integer;
begin
  PaxCompiler1.Reset;
  PaxCompiler1.RegisterLanguage(PaxPascalLanguage1);
 
  H_TButton := PaxCompiler1.RegisterClassType(0, TUniButton);
  PaxCompiler1.RegisterVariable(0, 'UniButton16', H_TButton, @UniButton16);
 
  PaxCompiler1.AddModule('1', PaxPascalLanguage1.LanguageName);
  PaxCompiler1.AddCode('1', UniMemo2.Lines.Text);
 
 
  if PaxCompiler1.Compile(PaxInterpreter1) then
    PaxInterpreter1.Run
  else
    for I:=0 to PaxCompiler1.ErrorCount - 1 do
      ShowMessage(PaxCompiler1.ErrorMessage);
end;
Link to comment
Share on other sites

  • 4 weeks later...

 

Here you go  :)

 

Add PaxCompiler, PaxPascalLanguage and PaxInterpreter to UniForm.

Add UniButton16 to UniForm

Add UniMemo2 to UniForm

 

Contents of UniMemo2:

begin
  UniButton16.Caption := 'Greets to Farshad';
end.
 

 

procedure TMainForm.UniButton16Click(Sender: TObject);
var
  I, H_TButton: Integer;
begin
  PaxCompiler1.Reset;
  PaxCompiler1.RegisterLanguage(PaxPascalLanguage1);
 
  H_TButton := PaxCompiler1.RegisterClassType(0, TUniButton);
  PaxCompiler1.RegisterVariable(0, 'UniButton16', H_TButton, @UniButton16);
 
  PaxCompiler1.AddModule('1', PaxPascalLanguage1.LanguageName);
  PaxCompiler1.AddCode('1', UniMemo2.Lines.Text);
 
 
  if PaxCompiler1.Compile(PaxInterpreter1) then
    PaxInterpreter1.Run
  else
    for I:=0 to PaxCompiler1.ErrorCount - 1 do
      ShowMessage(PaxCompiler1.ErrorMessage);
end;

 

Would anyone have an idea how to create a form using paxcompiler

Link to comment
Share on other sites

To my point of view :

 

- FastScript is very powerfull, easy to implement and to use. (Debug etc ...)

And it comes with FastReport ...

 

- PaxCompiler : I've never succed with it

 

- TMS Scripter : The only working under Android.

 

Using script with uniGui : the main problem is when you want a "ModalDialog" during your script, to allow user to answer question...

That's why we build something like "WorkFlow" to reproduce this step...

Link to comment
Share on other sites

  • 1 month later...

Tudo bem Herculano,

 

Consigui mapear quase todos os componentes do Unigui, o negócio ficou louco, estou fazendo uma aplicação que não vai precisar nem do Delphi, o problema e fazer todas as telas na mão, estou criando um Form Design, esta em 70%, consigo gerar DFM e Pas e ler em tempo de execução com o Script.  Pra você ter ideia consigui mapear ate as classes de conexão de banco de dados. Quando estivar funcional aviso.

 

Até..

  • Like 1
Link to comment
Share on other sites

Muito legal
Eu tenho um problema que não consegui identificar na criação de formulários.
Se deixo o formulário como FreeonClose ocorre acesso inválido de memória
Se deparou com algo assim?

 

very cool
I have a problem that I could not identify in form creation.
If I leave the form as FreeonClose invalid memory access occurs
Did you come across something like that?

 

exemple: Script

 

fm := TUniForm.CreateNew( Self );
fm.FreeOnClose := false;
fm.Caption := ':titulo';
fm.BorderStyle := bsSingle;
fm.BorderIcons := [biSystemMenu];
fm.Width := 350;
fm.Height := 240;

fm.showmodal;

 

procedure TScripter.CreateNewForm(AMachine: TatVirtualMachine);
begin
     With AMachine do
     begin
          //form := TUniForm.Create(UniApplication);
          ReturnOutputArg(ObjectToVar(TUniForm.Create(UniApplication)));
     end;
end;
 

with Scripter.AddDelphiClass(TUniForm) do
begin
      DefineMethod('CreateNew',1,tkClass,nil,CreateNewForm,true);
      DefineMethod('ShowModal',0,tkInteger,nil,ShowModalFormProc);
end;

 

Link to comment
Share on other sites

  • 3 months later...

Olá Herculano,

 

Também estou tentando fazer o Unigui funcionar com o TMS Scripter, porem não consegui avançar como você.

Quais classes você conseguiu mapear com o importtool, pois não estou conseguindo com sucesso.

 

Passa uma dica se possível.

 

Obrigado.

Link to comment
Share on other sites

  • 5 months later...
On 12/1/2017 at 3:33 PM, perjanbr said:

Tudo bem Herculano,

 

Consigui mapear quase todos os componentes do Unigui, o negócio ficou louco, estou fazendo uma aplicação que não vai precisar nem do Delphi, o problema e fazer todas as telas na mão, estou criando um Form Design, esta em 70%, consigo gerar DFM e Pas e ler em tempo de execução com o Script.  Pra você ter ideia consigui mapear ate as classes de conexão de banco de dados. Quando estivar funcional aviso.

 

Até..

Boa tarde meu nobre

Conseguiu avanço ?

Link to comment
Share on other sites

On 9/14/2018 at 1:19 PM, perjanbr said:

Show de bola

Link to comment
Share on other sites

  • 2 months later...
On 9/14/2018 at 8:19 PM, perjanbr said:

Hello there
The url you are showing does not work.

Can you share a sample code part of the script
I thank you for your help now.

Link to comment
Share on other sites

On 12/2/2017 at 12:43 AM, herculanojs said:

Muito legal
Eu tenho um problema que não consegui identificar na criação de formulários.
Se deixo o formulário como FreeonClose ocorre acesso inválido de memória
Se deparou com algo assim?

 

very cool
I have a problem that I could not identify in form creation.
If I leave the form as FreeonClose invalid memory access occurs
Did you come across something like that?

 

exemple: Script

 

fm := TUniForm.CreateNew( Self );
fm.FreeOnClose := false;
fm.Caption := ':titulo';
fm.BorderStyle := bsSingle;
fm.BorderIcons := [biSystemMenu];
fm.Width := 350;
fm.Height := 240;

fm.showmodal;

 

procedure TScripter.CreateNewForm(AMachine: TatVirtualMachine);
begin
     With AMachine do
     begin
          //form := TUniForm.Create(UniApplication);
          ReturnOutputArg(ObjectToVar(TUniForm.Create(UniApplication)));
     end;
end;
 

with Scripter.AddDelphiClass(TUniForm) do
begin
      DefineMethod('CreateNew',1,tkClass,nil,CreateNewForm,true);
      DefineMethod('ShowModal',0,tkInteger,nil,ShowModalFormProc);
end;

 

hi ,

Can you share a simple program example that illustrates the use of FastScript.
Thank you.

 

 

Link to comment
Share on other sites

  • 2 years later...
On 28/03/2018 at 14:35, emarquesc said:

Olá Herculano,

 

Também estou tentando fazer o Unigui funcionar com o TMS Scripter, porem não consegui avançar como você.

Quais classes você conseguiu mapear com o importtool, pois não estou conseguindo com sucesso.

 

Passa uma dica se possível.

 

Obrigado.

Hello, I managed to solve all the problems with TMS. Tell me which point has difficulty, that I can help you.

Link to comment
Share on other sites

On 14/09/2018 at 14:19, Jancarlos Martins said:

fora do ar

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...