Home Automation FAQ
Sponsored by Creative Control Concepts
Prev 5 | Prev | List | Next | Next 5
[Search] [Appearance] [Show Expert Edit Commands]
(Answer) (Category) Home Automation FAQ : (Category) HA Equipment : (Category) Creative Control Concepts/HCS-II : (Category) XPRESS Control Language :
Displaying Time variables
Variables which use the XPRESS Minute and Hour commands can sometime produce undesired results when displayed on the LCD-Link.   For example, two variables which save the time a low temperature is recorded are set using the XPRESS code:

LowTempMin = Minute
LowTempHr = Hour

However, when these variables are displayed using the %Px
format descriptor, the leading zeros are not displayed.   This makes
21:09 display as 21:9  .  But using the %R descriptor adds too many
leading zeros.

Here is an XPRESS code example which produces a more normal looking hour and minute format:

LCD(0) = "\e[2;7H%R0   \e[2;4H%R0\x3A", LowTempMin,LowTempHr
LCD(0) = "\e[2;4H\x20  \e[2;5H\x20"

First the minutes are displayed then their leading zeros are overwritten
by the hour display followed by a colon (\x3A).   The next line erases
out the hour's leading zeros with blanks (x\20).  If text precedes the hour digits, it can also be used instead of blanks to cover the unwanted leading zeros.
Subcategories:

Answers in this category:

ans-ins-part
Append to This Answer
Previous: (Answer) I upgraded to XPRESS v3.x and now my ADIO-Links won't work!
Next: (Answer) My minute timer only took 30 seconds?
This document is: http://www.automationfaq.com/cgi-bin/fom?file=182
[Search] [Appearance] [Show Expert Edit Commands]
This is a Faq-O-Matic 2.721.
This FAQ administered by Mike Baptiste