The following (reduced) program emits 3 identical warnings when compiled, and the warnings persist, showing up in the keypad/display device:
public camOfs, camPeriod, takePicture as boolean
beginProg
camOfs = 0
camPeriod = 15
if ifTime(camOfs,camPeriod,min) then takePicture = 1
endProg
The warnings look like this in the CRBasic editor:
line 5: Warning: Parameter will truncate to nearest integer.
line 5: Warning: Parameter will truncate to nearest integer.
line 5: Warning: Parameter will truncate to nearest integer.
Is there a way to turn the warnings off, or a better way to program this?
Reviewing the CRBasic help, the statement can be rewritten as an asignment, which at least only gives the warning twice:
takePicture = ifTime(camOfs,camPeriod,min)
CRBasic is at build 3.4.0.31, and the loggers are at OS 27.05.
(edit: the iftime() statement is used in a scan section, not as shown above.)
* Last updated by: kirving on 3/17/2015 @ 10:04 PM *
If you declare the two variables as long (which is recommended in the CRBasic help) it will resolve the issue. You won't get the warnings.
Public camOfs As Long, camPeriod As Long, takePicture As Boolean
BeginProg
camOfs = 0
camPeriod = 15
If IfTime(camOfs,camPeriod,min) Then takePicture = 1
EndProg
Thank you! I'd missed that in the help.
The same warning will not allow a compile and send from the following expression. Software version conflicts?
' Measure sensors -
If TimeIntoInterval(((Log_Interval*60)-SDI12TotalTime),(Log_Interval*60),sec)OR Flag(7)OR Flag(6)= True Then
TimeforSDI12 = True
EndIf
However, Log_Interval is input via user display, im wondering if there is an easy fix also?
Thanks
I do not get that warning if I change log_interval to also be defined as long.