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.

cr1000 compile warnings


kirving Mar 18, 2015 04:03 AM

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 *


GaryTRoberts Mar 18, 2015 05:01 AM

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


kirving Mar 18, 2015 06:33 AM

Thank you! I'd missed that in the help.


Will Mac Jun 15, 2018 03:06 AM

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


Terri Jun 15, 2018 05:49 PM

I do not get that warning if I change log_interval to also be defined as long.

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