5 line continuation, 6 inserting comments into program, 5 line – Campbell Scientific PC400 Datalogger Support Software User Manual

Page 185: Continuation -23, 6 inserting comments into program -23

Advertising
background image

Section 9. Datalogger Program Creation with CRBasic Editor

9.4.5 Line Continuation

Line continuation allows an instruction or logical line to span one or more
physical lines. This allows you to break up long lines of code into more
readable “chunks”. Line continuation is indicated by one white space character
that immediately precedes a single underscore character as the last character of
a line of text. Following is an example of line continuation:

Public Temp, RH, WindSp, WindDir, _
BatteryV, IntRH, IntTemp, RainTot, _
RainInt, Solar

9.4.6 Inserting Comments Into Program

It is often useful to provide comments in your datalogger program so that when
you review the program at a later date, you will know what each section of
code does. Comments can be inserted into the program by preceding the text
with a single quote. When the program is compiled, the datalogger compiler
will ignore any text that is preceded by a single quote. A comment can be
placed at the beginning of a line or it can be placed after program code. If
Syntax Highlighting is enabled (Options | Editor Preferences | Syntax
Highlighting), commented text will appear formatted differently than other
lines of code.

'CR5000

‘The following program is used to measure
'4 thermocouples

'VARIABLE DECLARATION
Dim TCTemp(4)

'Dimension TC measurement variable

Alias TCTemp(1)=EngineCoolantT

'Rename variables

Alias TCTemp(2)=BrakeFluidT
Alias TCTemp(3)=ManifoldT
Alias TCTemp(4)=CabinT


In the sample code above, the datalogger compiler will ignore the commented
text.

9-23

Advertising