mcCloud is coming soon!!!!
The following code produces an error on the line " StreamDecodeState = SDS_WaitingStart", "Variable SDS_WaitingStart is undeclared. How do I use enums?Class NMEADecoder Private StreamData As ListOfByte Enum StreamDecodeState As Integer SDS_WaitingStart = 0 SDS_WaitingEnd = 1 SDS_WaitingCS = 2 End Enum Private DecodeState As StreamDecodeState Public Sub New() StreamData = New ListOfByte DecodeState = SDS_WaitingStart End Sub
I've used enums in many cases, lots of the libraries use them, but in all cases they have to be declared outside of a class.Take a look at the MQTT, accelerator or Timer libraries to see how we are using them.
Enum StreamDecodeState As Integer SDS_WaitingStart = 0 SDS_WaitingEnd = 1 SDS_WaitingCS = 2End EnumClass MyClass Public Sub New() Dim state As StreamDecodeState = StreamDecodeState.SDS_WaitingCS End SubEnd Class