Welcome, Guest
Username: Password: Remember me
General discussions, feature requests for CodeTyphon Project and discussions that don't fit in any of the other specific CodeTyphon forum categories.
  • Page:
  • 1

TOPIC:

New component: THtmlPscl = THtmlViewer + MagicScript (best Pascal Script) 1 year 6 months ago #17347

  • Augusto Angelim
  • Augusto Angelim's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Hey,
This is the first version of the component that binds THtmlViewer + MagicScript
Lets you run a pascal script when loading an HTML page!

Easy to use!

It comes with a small manual and an example project of use of the "suite" type.

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

New component: THtmlPscl = THtmlViewer + MagicScript (best Pascal Script) 1 year 6 months ago #17348

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4508
  • Thank you received: 1100
Thanks Sir
some functions are missing, we can't build the pkg.



 
PilotLogic Architect and Core Programmer
Attachments:
The following user(s) said Thank You: Augusto Angelim

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

New component: THtmlPscl = THtmlViewer + MagicScript (best Pascal Script) 1 year 6 months ago #17349

  • Augusto Angelim
  • Augusto Angelim's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Forgive me!
Forgot to mention that I modified Magic Script to load "frm" and automatically load all classes registered in RTTI!

I Will send sources!

The project that loads "frm" in MagicScript is in testing!

Lke this:
On Unit:

procedure TfrmPrincipal.ScriptLocal;
var
   pscl : TmscrPascalScript;
begin
  if OpenDialogPSCL.Execute then begin
     //
     pscl := TmscrPascalScript.Create(Self);
     pscl.Lines.LoadFromFile( OpenDialogPSCL.FileName );
     //s
     pscl.ScriptPath:= ExtractFilePath(OpenDialogPSCL.FileName);
     pscl.IncludePath.Add(ExtractFilePath(OpenDialogPSCL.FileName));
     //
     pscl.AddRTTI;
     pscl.RegisterRTTI2Application;  // Register all components
     pscl.ProcessDiretives;  // Process "diretive"  "{FORM someform.frm}" on script
     //
     if pscl.Compile then begin
        pscl.Execute;
     end
     else begin
        memoPainel.Text :='Erro no script';
        memoPainel.Lines.Add( pscl.ErrorPos );
        memoPainel.Lines.Add( pscl.ErrorMsg );
//        memoPainel.Lines.Add( pscl.Lines.Text);
     end;
     //
   end;
end;

On Script:

PROGRAM ms;

{FORM ms.frm} // Diretive to load form "ms.frm"} That's OK!!!

Uses 'msf.pscl';

procedure Click1(Sender: TObject);
begin
   Self.Caption := 'Script ON';
   Self.Label1.Caption := 'Label: ' + TimeToStr(NOW);
   Self.Edit1.Text := 'Glórias a DEUS!!!';
   Self.memo1.lines.Add(Self.Name);
   msfProc('Augusto');
end;

procedure Click2(Sender: TObject);
begin
   if ExecScript(Self,'ms.pscl') then
         Self.memo1.lines.add('execScript Ok')
   else  Self.memo1.lines.add('execScript ERRO');
end;


begin
   Self.Caption := 'Caption do Script';
   Self.Button1.OnClick := @click1;
   Self.Button2.OnClick := @click2;
   Self.Caption := Self.Name;
   Self.Show;
end.

This works SO FINE!!!

Thanks Sir!

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

Last edit: by Augusto Angelim.
  • Page:
  • 1