Displaying Logic timer as h:m:s

Discussion in 'Pascal Logic Code Examples' started by jmargyle, Jun 28, 2014.

  1. jmargyle

    jmargyle

    Joined:
    Dec 7, 2013
    Messages:
    5
    Likes Received:
    0
    Location:
    Parramatta
    I want to display a logic timer value on a colour touch screen in Hours Minutes and Seconds.
    Can anyone help with the required code procedure.
    Note sure if I need to use DecodeTimer and user I/O
     
    jmargyle, Jun 28, 2014
    #1
  2. jmargyle

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    Create a user systemIO string called say TimeString;
    Put a level component on the page and select the system io as its value
    Logic:

    Code:
    Global variables:
     ourTime: integer;
     timeString: string;
    
    Module: 
    
    if timerTime(1) <>  ourTime then
    begin
      ourTime:= timerTime(1);
      durationToString(ourTime, timeString);
      SetStringSystemIO("timeString", timeString);
    end;
     
    Last edited by a moderator: Jun 29, 2014
    Ashley, Jun 28, 2014
    #2
  3. jmargyle

    jmargyle

    Joined:
    Dec 7, 2013
    Messages:
    5
    Likes Received:
    0
    Location:
    Parramatta
    Thanks Ashley
    I just had to change

    SetStringSystemIO("timeString", tempStr1);
    To
    SetStringSystemIO("timeString", timeString);

    Works well and I can build on this.

    Thanks again

    John
     
    jmargyle, Jun 29, 2014
    #3
  4. jmargyle

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    Sorry. Just a typo. I have a number of temporary variables set up to test out logic and then change them to something meaningful when I post it. I've edited the post for future reference.
     
    Ashley, Jun 29, 2014
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.