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.

Displaying text in RTMC using Digital


MortenS Mar 8, 2011 10:56 AM

I try to display a string in RTMC. (RTMC Pro v3.2, CR1000, LoggerNet 4.1)
I use the "123ABC Digital" display function and selected my public variabel "test" as

When running, the "123ABC Digital" display function is only showing "NAN"

My program is like this:

Public test as string *35

BeginProg
Scan (1,Sec,0,0)
test = "message"
NextScan
EndProg

* Last updated by: MortenS on 3/8/2011 @ 4:01 AM *


IslandMan Mar 8, 2011 11:50 AM

If the string "test" is in the Public table make sure you are collecting that table with Loggernet. Check in SETUP then DataFiles Tab for your station.


MortenS Mar 8, 2011 12:44 PM

Hi Dave

I found the error.

I actually declared 2 string varibles like this:
Public test1,test2 as string


I should have done it like this:
Public test1 as string,test2 as string


I think the compiler should have catched that as and error. But that is only my suggestion :-)

Anyway, thanks for your reply

Regards

Morten Skov


Dana Mar 8, 2011 09:01 PM

Hello Morten,

It is valid in CRBasic to declare multiple variables of different types on the same line. If a data type is not defined for a variable, then it is assumed to be a floating point value. Your line of code:

Public test1,test2 as string

is the same as:

Public test1 as float, test2 as string

The above is valid syntax in the programming language (thus, no compiler error).

Dana W.


MortenS Mar 9, 2011 08:34 AM

Thanks Dana

It make sense to me now :-)

morten

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