Hi guys,
This is bending my mellon a bit.
Trying to use globalStore to save a bit of text. It basically keeps track of the stage of a particular operation.
In one section of code I do
...
SetMode("init")
...
Sub SetMode(Data As String)
GlobalStore.Put(0, Data)
End Sub
And then in another sub (a timer tick) I have
Sub tmr0_Tick
Log("Ticking - ", GetMode)
Select GetMode
Case "init"
Log("Goto Login")
astream_NewData(Array As Byte())
Case "Closing"
serial.Close
Case Else
Log("'", GetMode, "'")
End Select
End Sub
Note the Log()'s are to try help me see what is going on.
GetMode is as follows
Sub GetMode() As Byte()
Return GlobalStore.Slot0
End Sub
The strange thing is the Case "init" never happens. The log shows as follows
Ticking - init
'init'
Ticking - init
'init'
So, it always goes to the Case Else, which logs the mode as init
I have tried setting the return type of the GetMode sub to String and the log then looks like
Ticking - 1073669680
'1073669680'
Ticking - 1073669680
'1073669680'
I have tried changing the Case to this number, both as an Int and a String. Still no joy
So, the big question is, what am I missing, why does "init" not equal "init"?
p.s. Wemos D1 mini