File: example5.e

package info (click to toggle)
smarteiffel 1.1-11
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 12,288 kB
  • ctags: 40,785
  • sloc: ansic: 35,791; lisp: 4,036; sh: 1,783; java: 895; ruby: 613; python: 209; makefile: 115; csh: 78; cpp: 50
file content (55 lines) | stat: -rw-r--r-- 1,293 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

class EXAMPLE5
--
-- Using different languages: TIME_IN_FRENCH, TIME_IN_ENGLISH,
-- TIME_IN_ITALIAN, TIME_IN_GERMAN, ...
--

creation make

feature {NONE}

   make is
      local
         time: TIME;
         french: TIME_IN_FRENCH;
         english: TIME_IN_ENGLISH;
         italian: TIME_IN_ITALIAN;
	 german: TIME_IN_GERMAN;
	 spanish : TIME_IN_SPANISH
      do
         time.update;

         io.put_string("The French format :%N");
         french.set_time(time);
         show_time(french);

         io.put_string("The English format :%N");
         english.set_time(time);
         show_time(english);

         io.put_string("The Italian format :%N");
         italian.set_time(time);
         show_time(italian);

         io.put_string("The German format :%N");
         german.set_time(time);
         show_time(german);

         io.put_string("The Spanish format :%N");
         spanish.set_time(time);
         show_time(spanish);
      end;

   show_time(format: TIME_IN_SOME_LANGUAGE) is
      do
         format.set_short_mode(false);
         io.put_string("        ");
         io.put_string(format.to_string);
         io.put_string("%N        ");
         format.set_short_mode(true);
         io.put_string(format.to_string);
         io.put_new_line;
      end;

end