04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Section 7. Installation<br />

7.7.3.3.1 Multiple Statements on One Line<br />

operator is located in the Help files of CRBasic Editor, which is included with<br />

LoggerNet, PC400, and RTDAQ datalogger support software suites.<br />

Multiple short statements can be placed on a single text line if they are separated<br />

with a colon. This is a convenient feature in some programs. However, in<br />

general, programs that confine text lines to single statements are easier for<br />

humans to read.<br />

In most cases, regarding statements separated by : as being separate lines is safe.<br />

However, in the case of an implied EndIf, CRBasic behaves in what may be an<br />

unexpected manner. In the case of an If...Then...Else...EndIf statement, where<br />

the EndIf is only implied, it is implied after the last statement on the line. For<br />

example:<br />

does not mean:<br />

If A then B : C : D<br />

If A then B (implied EndIf) : C : D<br />

Rather, it does mean:<br />

If A then B : C : D (implied EndIf)<br />

7.7.3.3.2 One Statement on Multiple Lines<br />

Long statements that overrun the CRBasic Editor page width can be continued on<br />

the next line if the statement break includes a space and an underscore ( _). The<br />

underscore must be the last character in a text line, other than additional white<br />

space. A line continuation allows a CRBasic statement (executable line of text) to<br />

span more than one file line.<br />

Note CRBasic statements are limited to 512 characters, whether or not a line<br />

continuation is used.<br />

Examples:<br />

7.7.3.4 Single-Line Declarations<br />

Public A, B, _<br />

C,D, E, F<br />

If (A And B) _<br />

Or (C And D) _<br />

Or (E And F) then ExitScan<br />

Public, Dim, and ReadOnly variables are declared at the beginning of a CRBasic<br />

program, as are Constants, Units, Aliases, StationNames, DataTables, and<br />

Subroutines. Table Rules for Names (p. 140) lists declaration names and allowed<br />

lengths.<br />

7.7.3.4.1 Variables<br />

A variable is a packet of memory given an alphanumeric name through which<br />

pass measurements and processing results during program execution. Variables<br />

are declared either as Public or Dim at the discretion of the programmer. Public<br />

115

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!