Re: EUPHORIA Digest - 24 Oct 1998 to 25 Oct 1998 (#1998-161)

new topic     » topic index » view thread      » older message » newer message

This is a nice example, of a place, where Euphoria can make it a lot
simpler, just by being Euphoria..


This program does preciously the same thing:


-- rldate.e------------

constant
DAYS = {
    "Sunday",
    "Monday",
    "Tuesday",
    "Wednesday",
    "Thursday",
    "Friday",
    "Saturday"
           },
MONTHS = {
    "January",
    "February",
    "March",
    "April",
    "May",
    "June",
    "July",
    "August",
    "September",
    "Oktober",
    "November",
    "December"
               }

global function rldate ()
sequence date_seq, text
integer day

    date_seq = date ()

    -- Name of the day and month
    text = DAYS[date_seq[7]] & ' '
          & MONTHS[date_seq[2]]

    -- Add day
    day = date_seq[3]
    if day = 1 then
        text = text & " 1st"
    elsif day = 2 then
        text = text & " 2nd"
    elsif day = 3 then
        text = text & " 3rd"
    else
        text = text & sprintf (" %dth",{day})
    end if

    -- Add year
    text = text & sprinft(", %d", {date_seq[1]+1900})

    return text
end function

-- end of rldate.e---------------

Ralf Nieuwenhuijsen
nieuwen at xs4all.nl
ralf_n at email.com
tp2 at email.com
UIN: 9389920

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu