none
Condition Question RRS feed

  • Question

  • heres the lowdown;
    in new to programming!

    current code is:

    if (clock.hour < 12) then
    textwindow.writeline("Good Morning")
    endif

    if (clock.hour >= 12) then
    textwindow.writeline("Good Afternoon")
    endif

    if (clock.hour >=17) then
    textwindow.writeline("good evening")
    endif

    im trying to get the middle if condition to be between 12 and 17, cant seem to figure it out

    any ideas?
    Thursday, March 12, 2009 11:59 AM

Answers

  • Try This

    if (clock.hour < 12) then
    textwindow.writeline("Good Morning")
    endif

    if (clock.hour >= 12 And Clock.Hour < 17) then
    textwindow.writeline("Good Afternoon")
    endif

    if (clock.hour >=17) then
    textwindow.writeline("good evening")
    endif

    JR

    • Marked as answer by Smiffsta Thursday, March 12, 2009 12:59 PM
    Thursday, March 12, 2009 12:50 PM
    Answerer

All replies

  • Try This

    if (clock.hour < 12) then
    textwindow.writeline("Good Morning")
    endif

    if (clock.hour >= 12 And Clock.Hour < 17) then
    textwindow.writeline("Good Afternoon")
    endif

    if (clock.hour >=17) then
    textwindow.writeline("good evening")
    endif

    JR

    • Marked as answer by Smiffsta Thursday, March 12, 2009 12:59 PM
    Thursday, March 12, 2009 12:50 PM
    Answerer
  • ahah thankyou,

    i see now that i have to define what to look for again by adding the 'and clock.hour < 17'

    before i was jus trying 'and < 17' or '>=12 <7' neither of which worked. thankyou!
    Thursday, March 12, 2009 1:01 PM