SPLat Logo

Formatting functions

NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map

Formatting functions

Formatting functions are a way of specifying data memory (RAM) variables or register contents as arguments in hash functions. Some examples:


#HMI ButtonEvent2( id:b(*Foo), t:("Count=", b(=x) ) ;Fetch RAM byte (8-bit) variable Foo and use as the id, change the button text to "Count=nnn"

#HMI Print( f(*fTherm,5,1), "°C" ) ;Fetch RAM floating point variable fTherm and print as "nnn.n°C"

#HMI Print( "Threshold: ", b(=x), "%") ;Print the byte (8-bit) value in X as "Threshold: nnn%"

The first and last of the above use the b() formatting function. The second one uses the f() formatting function.

Formatting functions are supported only by HMI related hash functions. They give you a powerful and flexible way of programmatically controlling the display. Each hash function's page states explicitly if it supports formatting functions.

Note that these formatting functions apply to most (but not necessarily all) of the parameters of the HMI hash functions.

Restrictions:

  1. #EQU values cannot be used inside formatting functions.