Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

CLU reference manual

.pdf
Скачиваний:
11
Добавлен:
23.08.2013
Размер:
407.81 Кб
Скачать

A.10. INPUT/OUTPUT

417

Overview

Dates are immutable objects that represent calendar dates and times.

Operations

create = proc (day, month, year, hour, minute, second: int) returns (date) signals (bad format)

e ects Creates the speci ed date. The ranges for the arguments

are

(1 ..

31), (1 12), (1 ), (0 23), (0 59), (0 59),.. .. .. .. ..

respectively

bad

 

format is signaled if an argument is out of

 

range.

 

 

 

 

get all = proc (d: date) returns (int, int, int, int, int, int)

e ects Returns the components in the same order as given to create.

get day = proc (d: date) returns (int) get month = proc (d: date) returns (int) get year = proc (d: date) returns (int) get hour = proc (d: date) returns (int) get minute = proc (d: date) returns (int) get second = proc (d: date) returns (int)

e ects Returns the speci ed component of d.

unparse = proc (d: date) returns (string)

e ects Returns a string representation of d|for example, \12 January 1978 01:36:59".

unparse date = proc (d: date) returns (string)

e ects Returns a string representation of the date part of d|for example, \12 January 1978".

unparse time = proc (d: date) returns (string)

e ects Returns a string representation of the time part of d|for example, \01:36:59".

lt = proc (d1, d2: date) returns (bool)) le = proc (d1, d2: date) returns (bool) ge = proc (d1, d2: date) returns (bool) gt = proc (d1, d2: date) returns (bool)

equal = proc (d1, d2: date) returns (bool) e ects The obvious relational operations

if d1 < d2 , then d1 occurs earlier than d2.

similar = proc (d1, d2: date) returns (bool) e ects The same as the equal operation.

copy = proc (d: date) returns (date) e ects Returns a date equal to d.

end date

418

APPENDIX A. CLU REFERENCE MANUAL