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.

Measurement Matters - Variable Initialization


jra Sep 3, 2014 05:31 PM

Q: What is the default value of a variable? And, how do I change it?

A: By default, variables are set equal to zero at the time the datalogger program compiles. Variables can be initialized to non-zero values in the declaration portion of a CRBasic program.

CRBasic Examples:
Public aaa As Long = 1
Public bbb (2) As String *20 = {"String_1", "String_2"}
Public ccc As Boolean = True
Dim eee = 1.5

Source: CR1000 manual section 7.7.3.4.1 Variables

Tip: FALSE is the Boolean translation of zero. By default, Boolean variables initialize to FALSE.

Next week: Power budgets

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