Subversion Repositories Kolibri OS

Rev

Rev 8860 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8860 Rev 9648
Line 1... Line 1...
1
MODULE HW_con;
1
MODULE HW_con;
Line -... Line 2...
-
 
2
 
2
 
3
IMPORT
Line 3... Line 4...
3
IMPORT Out, In, Console, DateTime;
4
	Out, In, Console, DateTime;
4
 
5
 
5
 
6
 
Line 14... Line 15...
14
 
15
 
15
 
16
 
16
PROCEDURE OutMonth(n: INTEGER);
17
PROCEDURE OutMonth (n: INTEGER);
17
VAR
-
 
18
    str: ARRAY 4 OF CHAR;
18
VAR
19
 
-
 
20
BEGIN
19
	str: ARRAY 4 OF CHAR;
21
 
20
BEGIN
22
    CASE n OF
21
	CASE n OF
23
    | 1: str := "jan"
22
	| 1: str := "jan"
24
    | 2: str := "feb"
23
	| 2: str := "feb"
Line 31... Line 30...
31
    | 9: str := "sep"
30
	| 9: str := "sep"
32
    |10: str := "oct"
31
	|10: str := "oct"
33
    |11: str := "nov"
32
	|11: str := "nov"
34
    |12: str := "dec"
33
	|12: str := "dec"
35
    END;
34
	END;
36
 
-
 
37
    Out.String(str)
35
	Out.String(str)
38
END OutMonth;
36
END OutMonth;
Line 39... Line 37...
39
 
37
 
40
 
38
 
-
 
39
PROCEDURE main;
41
PROCEDURE main;
40
VAR
42
VAR
-
 
43
    Year, Month, Day, Hour, Min, Sec, Msec: INTEGER;
41
	Year, Month, Day,
44
 
42
	Hour, Min, Sec, Msec: INTEGER;
45
BEGIN
43
BEGIN
46
    Out.String("Hello, world!"); Out.Ln;
44
	Out.String("Hello, world!"); Out.Ln;
47
    Console.SetColor(Console.White, Console.Red);
45
	Console.SetColor(Console.White, Console.Red);
48
    DateTime.Now(Year, Month, Day, Hour, Min, Sec, Msec);
-
 
49
    Out.Int(Year, 0); Out.Char("-");
46
	DateTime.Now(Year, Month, Day, Hour, Min, Sec, Msec);
50
    OutMonth(Month);  Out.Char("-");
47
	OutInt2(Day); Out.Char("-"); OutMonth(Month); Out.Char("-"); Out.Int(Year, 0); Out.Char(" ");
51
    OutInt2(Day);     Out.Char(" ");
48
	OutInt2(Hour); Out.Char(":"); OutInt2(Min); Out.Char(":"); OutInt2(Sec); Out.Ln;
52
    OutInt2(Hour);    Out.Char(":");
49
	Console.SetColor(Console.Blue, Console.LightGray);
53
    OutInt2(Min);     Out.Char(":");
50
	Out.Ln; Out.String("press enter...");
Line 54... Line 51...
54
    OutInt2(Sec)
51
	In.Ln
55
END main;
52
END main;
56
 
53
 
57
 
-
 
58
BEGIN
54
 
59
    Console.open;
55
BEGIN
60
    main;
56
	Console.open;