You beat me to it.

I use a similar process for monitoring the temperatures in my Vivariums, and sounding an alarm if they exceed a set range. Basically

Code:
IF Temperature >  alarmhigh  then AlarmPin = 1
IF Temperature <  alarmlow  then AlarmPin = 1
The variables used are word type so in my code for the thermostat 23.6C would be stored as 236. Likewise a high threshold would be 350 (35.0c)