Alpha Video Training
Results 1 to 8 of 8

Thread: Clock Question

  1. #1
    Member
    Real Name
    Melvin
    Join Date
    Nov 2011
    Posts
    133

    Question Clock Question

    Hi All

    I have a simple 12hr digital clock on my main menu form that is based on a variable called vc_curr_time.

    I want the font color to turn red after 4:00pm and then back to black after 5:00pm.

    When I go into Field Properties, Color Equation I see that I can enter a number of expressions to change the font color.

    The problem I am having is with building the expression.

    Can anyone advise how to best build this expression?

    Thanks

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Clock Question

    Try

    between(ctime(vc_curr_time),cdate(date())+"160000000",cdate(date())+"165999999")

  3. #3
    Member
    Real Name
    Melvin
    Join Date
    Nov 2011
    Posts
    133

    Default Re: Clock Question

    Hi Stan

    That expression gave me an invalid expression error.

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Clock Question

    So your variable vc_curr_time is probably a character variable? What is a sample value it might hold?

    Likely you want

    between(ctime(ctodt(vc_curr_time)),cdate(date())+"160000000",cdate(date())+"165999999")

  5. #5
    Member
    Real Name
    Melvin
    Join Date
    Nov 2011
    Posts
    133

    Default Re: Clock Question

    Yeah...It is a character variable.

    It is built as a Layout Variable and the code is vc_curr_time = ""

    And my form has the following ontimer event this:vc_curr_time.text = time("0h:0m AM")

    I've implemented the expression you provided me with. Since it in only 2:22pm where I am, can I change the time to 140000000 to see if the code works?

  6. #6
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Clock Question

    Not going to work. You really don't have enough data in the variable for what I suggested.

  7. #7
    Member
    Real Name
    Melvin
    Join Date
    Nov 2011
    Posts
    133

    Default Re: Clock Question

    Stan

    Would something like this work?

    Var->vc_curr_time>"140000000"

  8. #8
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Clock Question

    No. Your "current time" variable value is in the form "04:29 pm". Var->vc_curr_time>"140000000" isn't going to make the kind of comparison you want.

    I'll make some more suggestions tomorrow.

Similar Threads

  1. Clock Control
    By tojames in forum Alpha Five Version 10 - Desktop Applications
    Replies: 0
    Last Post: 03-18-2010, 03:30 PM
  2. Clock on form
    By mronck in forum Alpha Five Version 5
    Replies: 6
    Last Post: 04-19-2004, 03:41 AM
  3. Toolbar Clock
    By JerryBrightbill in forum Code Archive
    Replies: 0
    Last Post: 12-20-2002, 05:55 AM
  4. V4.5 to V5 Clock conversion
    By forskare in forum Alpha Five Version 5
    Replies: 3
    Last Post: 11-26-2002, 06:06 PM
  5. Time Clock Question
    By Bob Elliott in forum Alpha Five Version 4
    Replies: 2
    Last Post: 01-06-2002, 12:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •