-- +------------------------------------ -- | Copyright 1992-1997 Future Parallel -- | VLSI Design Lab -- | Library: VFP -- | Designer: Tim Pagden -- | Opened: 28 Dec 1997 -- +------------------------------------ package body time_class is -- time defined in std.standard function longest ( -- 10.05.93 a, b: time ) return time is variable y: time; begin if (a >= b) then y := a; else y := b; end if; return y; end longest; function longest ( -- 31.05.93 a, b, c: time ) return time is variable ab: time; variable y: time; begin if (a >= b) then ab := a; else ab := b; end if; if (ab >= c) then y := ab; else y := c; end if; return y; end longest; function longest ( -- 31.05.93 a, b, c, d: time ) return time is variable ab: time; variable cd: time; variable y: time; begin if (a >= b) then ab := a; else ab := b; end if; if (c >= d) then cd := c; else cd := d; end if; if (ab >= cd) then y := ab; else y := cd; end if; return y; end longest; function longest ( -- 31.05.93 a, b, c, d, e: time ) return time is variable ab: time; variable cd: time; variable cde: time; variable y: time; begin if (a >= b) then ab := a; else ab := b; end if; if (c >= d) then cd := c; else cd := d; end if; if (cd >= e) then cde := cd; else cde := e; end if; if (ab >= cde) then y := ab; else y := cde; end if; return y; end longest; function longest ( -- 31.05.93 a, b, c, d, e, f: time ) return time is variable ab: time; variable cd: time; variable ef: time; variable abcd: time; variable y: time; begin if (a >= b) then ab := a; else ab := b; end if; if (c >= d) then cd := c; else cd := d; end if; if (e >= f) then ef := e; else ef := f; end if; if (ab >= cd) then abcd := ab; else abcd := cd; end if; if (abcd >= ef) then y := abcd; else y := ef; end if; return y; end longest; function longest ( -- 31.05.93 a, b, c, d, e, f, g: time ) return time is variable ab: time; variable cd: time; variable ef: time; variable efg: time; variable abcd: time; variable y: time; begin if (a >= b) then ab := a; else ab := b; end if; if (c >= d) then cd := c; else cd := d; end if; if (e >= f) then ef := e; else ef := f; end if; if (ef >= g) then efg := ef; else efg := g; end if; if (ab >= cd) then abcd := ab; else abcd := cd; end if; if (abcd >= efg) then y := abcd; else y := efg; end if; return y; end longest; function longest ( -- 31.05.93 a, b, c, d, e, f, g, h: time ) return time is variable ab: time; variable cd: time; variable ef: time; variable gh: time; variable abcd: time; variable efgh: time; variable y: time; begin if (a >= b) then ab := a; else ab := b; end if; if (c >= d) then cd := c; else cd := d; end if; if (e >= f) then ef := e; else ef := f; end if; if (g >= h) then gh := g; -- g > h else gh := h; -- h > g end if; if (ab >= cd) then abcd := ab; else abcd := cd; end if; if (ef >= gh) then efgh := ef; else efgh := gh; end if; if (abcd >= efgh) then y := abcd; else y := efgh; end if; return y; end longest; function longest ( -- 31.05.93 a, b, c, d, e, f, g, h, i: time ) return time is variable ab: time; variable cd: time; variable ef: time; variable gh: time; variable ghi: time; variable abcd: time; variable efghi: time; variable y: time; begin if (a >= b) then ab := a; else ab := b; end if; if (c >= d) then cd := c; else cd := d; end if; if (e >= f) then ef := e; else ef := f; end if; if (g >= h) then gh := g; -- g > h else gh := h; -- h > g end if; if (gh >= i) then ghi := gh; -- ">"(g,h) > i else ghi := i; -- i > g,h end if; if (ab >= cd) then abcd := ab; else abcd := cd; end if; if (ef >= ghi) then efghi := ef; else efghi := ghi; end if; if (abcd >= efghi) then y := abcd; else y := efghi; end if; return y; end longest; -- property functions function string_length ( -- 11.02.1999 a: time ) return integer is use std.textio.all; variable a_time : time; variable time_line : line; variable num_chars : integer := 0; variable result : integer; begin -- copy a so you can use real subtypes (ronustly), too a_time := a; -- write a to a line, then L'length should return the number of chars, surely write(time_line, a_time); num_chars := time_line'LENGTH; deallocate(time_line); result := num_chars; return result; end string_length; end time_class;