Ada

Hello world

hello.adb

   1 with Ada.Text_IO;
   2 -- comment 
   3 procedure Hello is
   4 begin
   5    Ada.Text_IO.Put_Line("Hello, world!");
   6 end Hello;

Hello date

hellodate.adb

   1 with ada.text_io;
   2 use ada.text_io;
   3 with gnat.calendar.time_io;
   4 use gnat.calendar.time_io;
   5 with ada.calendar;
   6 use ada.calendar;
   7 
   8 procedure HelloDate is
   9     datetime: string(1..26); -- has exactly 26 chars
  10 begin
  11     -- gets date to string with milliseconds
  12     datetime := image( clock, "[%Y-%m-%dT%H:%M:%S.%i] " );
  13     -- concatenetas string and shows date
  14     put_line( datetime & "stuff " );  
  15 end HelloDate;

Ada (last edited 2019-07-18 20:52:56 by localhost)