BFormat: WeatherService example

This example uses the WeatherService to show another way to use BFormat script.

An ORD as a reference

The WeatherService can provide many pieces of information, including current conditions and forecasts.

Figure 1. Example Weather Report property sheet


To display this information on a graphic you create a bound label that references the WeatherService and the applicable property. For example, to display the forecast for today in Charlotte, NC, the referenced ORD would be station:|slot:/Services/WeatherService/Charlotte/day0.

Default BFormat script

Instead of entering this ord, you could expand the WeatherService in the Nav tree to find this slot, then drag it to the Px page, where the Make Widget wizard automatically resolves to this ord. The default BFormat script of %.% for Text returns the information shown as the second line in the following image.

Figure 2. Default BoundLabel Text to Weather Report’s Today property


Modified BFormat script

To further control weather values, you can add additional BFormat scripts. For example, setting Text to the following:

High %High.value% °F / Low %Low.value% °F / Precip %PrecipChance.value%%%
returns the information shown in the second line of the following image.
Figure 3. Example of a modified BoundLabel Text to Weather Report’s Today property


Note: The system uses the percentage symbol (%) To delimit scripts in format Text fields. To display this symbol as text, enter two of them (%%).