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 - DataTable Data Access


jra Sep 23, 2014 03:31 PM

Q: How do I use data from a stored DataTable() in my program? For example, I’d like to display, in the Public Table, yesterday’s total rain.

A: Accessing data already stored in a Table requires the use of special syntax available in CRBasic, this syntax is uses the form TableName.FieldName Let’s say a DataTable looks like this:
DataTable (Daily,1,-1)
DataInterval (0,1,Day,10)
Totalize (1,rain,FP2,False)
EndTable

Use this syntax: RainYesterday = Daily.rain_tot to write yesterday’s total rain to a Public variable called RainYesterday.

Tip #1: Once you save your program in the CRBasic Editor use Tools|Show Tables to display the FieldNames defined in each DataTable.

And, no, CRBasic is not case sensitive.

Tip #2: Type DataTable access into the CRBasic Help Index for quick reference.

Learn more: Take a look at the last page in this newsletter: http://s.campbellsci.com/documents/au/newsletters/online37.pdf

Next week: More on FieldNames

* Last updated by: Janet on 9/23/2014 @ 9:34 AM *

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