Date and time program

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

Here. Dt.ex:
include graphics.e
include get.e
object dl,dly
global procedure beep()
dly=date()
dly=dly[6]
dl=date()
dl=dl[6]
while dl=dly do
dl=date()
dl=dl[6]
sound(1000)
end while
sound(0)
end procedure
sequence dt
object hour
object min
object sec
object ampm
object mo
clear_screen()
while get_key()=-1 do
    text_color(4)
    position(1,1)
    puts(1," Sun Mon Tue Wed Thu Fri Sat")
    dt=date()
    if not compare(1,dt[7]) then
        text_color(12)
        position(1,2)
        puts(1,"Sun")
    end if
    if not compare(2,dt[7]) then
        text_color(12)
        position(1,6)
        puts(1,"Mon")
    end if
    if not compare(3,dt[7]) then
        text_color(12)
        position(1,10)
        puts(1,"Tue")
    end if
    if not compare(4,dt[7]) then
        text_color(12)
        position(1,14)
        puts(1,"Wed")
    end if
    if not compare(5,dt[7]) then
        text_color(12)
        position(1,18)
        puts(1,"Thu")
    end if
    if not compare(6,dt[7]) then
        text_color(12)
        position(1,22)
        puts(1,"Fri")
    end if
    if not compare(7,dt[7]) then
        text_color(12)
        position(1,26)
        puts(1,"Sat")
    end if
    position(3,1)
    hour=dt[4]
    min=dt[5]
    sec=dt[6]
    if hour>12 then
        hour=hour-12
        ampm=" pm"
    else
        ampm="am"
    end if
    if not compare(0,hour) and not compare(min,0) and not compare(sec,0)
then
        hour=12
        beep()
    end if
    if not compare(12,hour) and not compare(min,0) and not compare(sec,0)
then
        ampm="pm"
        beep()
    end if
    text_color(14)
    printf(1," %d:%d:%d %s               ",{hour,min,sec,ampm})
    position(1,30)
    mo=dt[2]
    text_color(15)
    if mo=1 then
         puts(1,"January  ")
    elsif mo=2 then
         puts(1,"February ")
    elsif mo=3 then
         puts(1,"March    ")
    elsif mo=4 then
         puts(1,"April    ")
    elsif mo=5 then
         puts(1,"May      ")
    elsif mo=6 then
         puts(1,"June     ")
    elsif mo=7 then
         puts(1,"July     ")
    elsif mo=8 then
         puts(1,"August   ")
    elsif mo=9 then
         puts(1,"September")
    elsif mo=10 then
         puts(1,"October  ")
    elsif mo=11 then
         puts(1,"November ")
    elsif mo=12 then
         puts(1,"December ")
    end if
    text_color(14)
    printf(1," %d, 19%d",{dt[3],dt[1]})
end while
position(4,1)

I think Euphoria programs run horribly slow in a DOS box. Have you ever
noticed, that in a DOS box the cursor's color is the opposite of the
background, but in full screen/pure dos mode, the cursor's color is the
same color as the foreground?
-------------------------------------
When it comes to programming languages, Euphoria is a cut above -
matt1278 at juno.com and matt1421 at juno.com(and soon to be
irisnmatt at prodigy.net. Then again, maybe not) Euphoria programmer

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

Search



Quick Links

User menu

Not signed in.

Misc Menu