Fix formatting of full version string.
nicolas.boulenguez
8 years ago
10 | 10 | |
11 | 11 | function N (Msg : String) return String renames Intl.Gettext; |
12 | 12 | |
13 | -- Set the major version here. | |
13 | 14 | Version_Number : constant String := "16"; |
15 | ||
16 | -- Translate the format, then replace the major version. | |
14 | 17 | Version_Format : constant String |
15 | 18 | := N ("music123 version %d by David Starner"); |
16 | Version : constant String := Ada.Strings.Fixed.Insert | |
17 | (Source => Version_Format, | |
18 | Before => Ada.Strings.Fixed.Index (Version_Format, Pattern => "%d"), | |
19 | New_Item => Version_Number); | |
19 | Version_Index : constant Positive := Ada.Strings.Fixed.Index | |
20 | (Source => Version_Format, | |
21 | Pattern => "%d"); | |
22 | Version : constant String := Ada.Strings.Fixed.Replace_Slice | |
23 | (Source => Version_Format, | |
24 | Low => Version_Index, | |
25 | High => Version_Index + 1, | |
26 | By => Version_Number); | |
20 | 27 | |
21 | 28 | Noted_Error : exception; |
22 | 29 |