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.

"Variable "x" out of bounds" - "x" not an array


antarcticstreams Dec 20, 2011 12:28 AM

I have a CR1000 issuing this warning on the CR1000KD upon connection, and while it's not interfering with my program or final storage data, it is annoying.

It comes from an SDI12Recorder instruction, and the destination variable is not defined as an array.

I am issuing "0M!" and the response is "00042". It's the "2" that's tripping things up (it indicates that 2 values can be collected on the following "0D0!" command). I checked this by re-defining my variable as variable(2) and tracking the two values during program execution. The warning stopped, which is fine, but the variable(2) being recorded is incorrect (I checked using the terminal emulator).

Suggestions on a solution? Do I even have a problem? It's mostly an aesthetic thing, plus I need to have inexperienced users access datalogger via keyboard and I'd like the interaction to be as straight-forward as possible.

I'm talking to an Accubar.


jra Dec 20, 2011 01:40 PM

For simplifying user interaction with the keyboard consider using a Custom Menu. In CRBasic, filter your instructions using the drop down list under the Help button of the instruction panel on the right hand side; select Custom Menus. Also, take a look at the DisplayMenu/EndMenu example.

For your original problem you could do something like this:
Dim accu(2)
Public accubar

then in the body of your program:
accubar = accu(1)

Let us know if you have other questions.

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