Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Use of IfTime or RealTime using CR3000 DL?


RDaly Sep 9, 2021 04:02 PM

I would like to use the IfTime or RealTime function to trigger a EmailRelay command at a given time of day or week. For example, an emailed system performance update sent weekly on Monday mornings at 1am.

Using CRBasic, I recieve an error "Undeclared variable RealTime" or "Undeclared variable IfTime" when using either function. Is there a problem using these functions with the CR3000? Other functions such as TimeIntoInterval work OK.

Below is an example for an email trigger to be set to true Monday at 01:00. 

If RealTime (8) = 1 and RealTime(4) = 1 Then
 EmailTrigger = True
EndIf

Thank you,

Ryan


JDavis Sep 10, 2021 09:31 PM

IfTime() functions equivalent to TimeIntoInterval(). TimeIntoInterval is a longer word to type, but preferred because it avoids some confusion of the double if.   "If TimeIntoInterval(..." and "If Iftime(..." are equivalent.

With RealTime() you need to declare a variable array to put the values into, and use the instruction RealTime() before your if statement to populate the variables. TimeIntoInterval() is often simpler to use.

Log in or register to post/reply in the forum.