If a message is text, and it is displayed in a debug
node it is colour: red with "
around it.
If it is a number it is blue.
If it is true
or false
it is blue.
That's where the problem (for me) starts.
In a function
node if I am looking at true
or false
(boolean) messages they are orange.
(Well, I'll call it orange for the sake it is not RED and not BLUE.)
I am trying to make a flow that deal with true
and false
messages.
I have a button which injects false
and it is going into nodes and nothing is happening.
Putting debug
nodes I am seeing BLUE message text with true (or) false.
(Given that there are also true
messages in the mix)
And I am not guaranteed that they are the boolean true
false
messages.
Anyone - please?
Yeah, ok. TEXT versions of true
will show up as "true"
and the boolean will simply be true
.
But why is it not shown as orange like in the function
node?
It would be much easier if you just pasted the output so we could see it.
I am going to be called a lot of names for this, but this is what I am seeing and am confused by it because of the lack of consistency.
1: boolean.
2: text
3: number
Note the colours as seen in a function
node.
Now in a debug
node:
Why can't the colours be the same?
A reasonable question. Right now the text editor uses a different colour palette to the rest of Node-RED. There's no special significance to the difference, just something we've never thought about. You are the first person to point it out. The colour is only a hint anyway - the quotes help differentiate a string from the other types regardless of colour.
3 Likes
Yes, and I have see this.
Just after more than an hour running around going nowhere with my other post (now updated) about message, topics, buttons etc. I was looking at the debug output on the left and seeing false
in blue rather than orange when viewed in the function node and got flustered with it maybe being text rather than boolean.
Event (repeating myself. Ok. I am sure you get it.)
I'll shut up now.
1 Like
It is a reasonable point for sure. However, the line above the data does clearly tell you what it is. Though only for a single value.
The debug colours were chosen to match the chrome browser dev tools.
4 Likes