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 *
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.
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
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.
Thanks Dana
It make sense to me now :-)
morten