With the release of Loggernet 4.0 many of the client applications have had some new features added. CRBasic is one of applications to receive a facelift and this article will list some of the new features as well as some of the most useful features from the old version of CRBasic.

Bookmarks

CRBasic programs can get pretty big for more complex applications, sometimes running to thousands of lines of code. For these programs, bookmarks are a useful tool to help when navigating between distant sections in code. To add a bookmark to a line, select Toggle Bookmark from the Goto -> Bookmarks menu.  

bookmarks

Then to move between bookmarks use the buttons in the bookmarks toolbar:

bookmark toolbar

Use the Previousback button and nextforward button buttons to jump between bookmarks, or use the Browse browse button

button to view all bookmarks in the current program.

Program Section Bookmarks

Bookmarks are automatically added for important program sections. These bookmarks are accessible through the Goto button on the toolbar:

program section bookmarks

Compile, Save and Send

When starting a new program, it is always advisable to keep testing the program by running it in a datalogger (if one is available) while you code. This avoids having to identify a problem in an entire program which has been written in one go from start to end. As long as Loggernet is open in the background, CRBasic can send the program to a datalogger without the need to switch to the Connect screen and press the Send Program button. 

compile save and send

The compile save and send button on the toolbar will save the current program to disk, perform a compile to make sure there are no errors, then display a list of all the dataloggers from the Loggernet connect screen which this program can be sent to.

Insert Variable

When typing code into the CRBasic editor, sometimes a public variable name is needed in a formula or If statement as shown below:
insert variable

If there are a large number of public variables it may be difficult to remember the exact spelling of the variable names. To bring up a list of all public variables at the current cursor position, press F9. Then select the appropriate variable from the list to insert it.

Associate Files

Loggernet does not associate .CRX files with the CRBasic editor by default. This means that double clicking on .CRX files in Windows Explorer will not open them in the CRBasic Editor. To associate certain datalogger program files with CRBasic, select Associate Files from the Tools menu:

associate files

associate files

Select the types of program to associate with the CRBasic editor, and then press Associate Files. These files should now have a CRBasic icon in windows explorer:

useful crbasic shortcuts

Keyboard Shortcuts

The table below shows a summary of some of the most useful keyboard shortcuts in the CRBasic editor.

keyboard shortcuts