Yes I know. Is covered in the first tutorial. My question is a different one.
No idea if I can formulate a more one.
That is the actual procedure:
package body BCI_Messages.IO is
---------
-- Put --
---------
procedure Put (File_Name: in String;
Item : in Object) is
begin -- Put
Ada.Text_IO.Put_Line (Item => File_Name);
Dossiers.IO.Put (Item => Item.Dossier);
end Put;
end BCI_Messages.IO;
So that would be the adapted one using Gnoga:
package body BCI_Messages.IO is
My_View : Gnoga.Gui.View.Console.Console_View_Type;
---------
-- Put --
---------
procedure Put (File_Name: in String;
Item : in Object) is
begin -- Put
My_View.Put_Line (Item => File_Name); <---
Dossiers.IO.Put (Item => Item.Dossier);
end Put;
end BCI_Messages.IO;
But that means I have also to adapt the Dossier.IO.Put as well as the other
procedures nested inside and those nested inside... to use the gnoga Put_Line.
There are quite a few levels of those.
What I wanted to know is if there is a way to use gnoga Put_Line (or others)
without changing everything. Like this:
---------
-- Put --
---------
procedure Put (File : in Ada.Text_IO.File_Type;
File_Name : in String;
Item : in Object) is
begin -- Put
Ada.Text_IO.Put_Line (File => File,
Item => File_Name);
Dossiers.IO.Put (File => File,
Item => Item.Dossier);
end Put;
---------
-- Put --
---------
procedure Put (File_Name : in String;
Item : in Object) is
begin -- Put
Put (File => Ada.Text_IO.Standard_Output, <------
File_Name => File_Name,
Item => Item);
end Put;
Instead of Ada.Text_IO.Standart_Output something like My_View.To_Gnoga.
So that in the main file I just have to call:
BCI_Messages.IO.Put (File => My_View.To_Gnoga,
File_Name => File_Name,
Item => Test_Message);
And the rest of the nested procedures wouldn’t require a rework. But I think
that would be illusional to believe that it could be so easy.
So I think that I have answered my own question?
Thanks
Laurent
> On 15.07.2015, at 13:15, Gautier de Montmollin <[email protected]> wrote:
>
> > First question: Is it possible to reroute the output of a
> > procedure/function which would normally be displayed in the terminal or
> > written to a file to Gnoga? So that the result appears in the browser
> > instead.
>
> You have Put, Put_Line, New_Line that write text directly to the browser
> window.
>
> Cheers
> Gautier
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/_______________________________________________
> <https://www.gigenetcloud.com/_______________________________________________>
> Gnoga-list mailing list
> [email protected] <mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/gnoga-list
> <https://lists.sourceforge.net/lists/listinfo/gnoga-list>
------------------------------------------------------------------------------
_______________________________________________
Gnoga-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gnoga-list