Size: 264
Comment:
|
Size: 1250
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 4: | Line 4: |
* https://craftofcoding.files.wordpress.com/2013/07/ada_strings.pdf * https://www.adaic.org/resources/add_content/standards/05rm/html/RM-TOC.html * https://ada-util.readthedocs.io/en/latest/Util_Dates/ * https://en.wikibooks.org/wiki/Ada_Programming/Libraries/GNAT.Calendar.Time_IO * https://www.tutorialspoint.com/compile_ada_online.php * https://docs.adacore.com/gnat_rm-docs/html/gnat_rm/gnat_rm/the_gnat_library.html |
|
Line 6: | Line 12: |
'''hello.adb''' | |
Line 8: | Line 15: |
-- comment | |
Line 14: | Line 21: |
* gnat make hello.adb == Hello date == '''hellodate.adb''' {{{#!highlight ada with ada.text_io; with gnat.calendar.time_io; with ada.calendar; procedure HelloDate is datetime: string(1..26); -- has exactly 22 chars begin -- gets date to string with milliseconds datetime := gnat.calendar.time_io.image( ada.calendar.clock, "[%Y-%m-%dT%H:%M:%S.%i] " ); -- concatenetas string and shows date ada.text_io.put_line( datetime & "stuff " ); end HelloDate; }}} * gnat make hellodate.adb |
Ada
https://craftofcoding.files.wordpress.com/2013/07/ada_strings.pdf
https://www.adaic.org/resources/add_content/standards/05rm/html/RM-TOC.html
https://en.wikibooks.org/wiki/Ada_Programming/Libraries/GNAT.Calendar.Time_IO
https://docs.adacore.com/gnat_rm-docs/html/gnat_rm/gnat_rm/the_gnat_library.html
Hello world
hello.adb
- gnat make hello.adb
Hello date
hellodate.adb
1 with ada.text_io;
2 with gnat.calendar.time_io;
3 with ada.calendar;
4
5 procedure HelloDate is
6 datetime: string(1..26); -- has exactly 22 chars
7 begin
8 -- gets date to string with milliseconds
9 datetime := gnat.calendar.time_io.image( ada.calendar.clock, "[%Y-%m-%dT%H:%M:%S.%i] " );
10 -- concatenetas string and shows date
11 ada.text_io.put_line( datetime & "stuff " );
12 end HelloDate;
- gnat make hellodate.adb