¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Parsing a string


 

¿ªÔÆÌåÓý

Advantage of a 50¡± 4k TV as a monitor. Good for my tired old eyes (age 59).

?

I do like your single function solution!

?

73

Dave wo2x

?

?

?

?

From: [email protected] <[email protected]> On Behalf Of Mick - W8BE
Sent: Friday, January 29, 2021 4:07 PM
To: [email protected]
Subject: Re: [nodered-hamradio] Parsing a string

?

Thanks Dave,? I caught it... I need a bigger monitor.? Doing it on a laptop screen.? ?It would seem Michaels has a plethora?of options available to him now.

?

On Fri, Jan 29, 2021 at 4:04 PM David De Coons wo2x <RocketNJ@...> wrote:

Hi Mick,

?

Close ?

Your msg6 if/else has true & true.(typo)

?

Here¡¯s the cleaned up, cleaned up version.

?

73

Dave wo2x

?

var output = msg.payload.split("");

msg.out0 = parseInt(output[0]);

msg.out1 = parseInt(output[1]);

msg.out2 = parseInt(output[2]);

msg.out3 = parseInt(output[3]);

msg.out4 = parseInt(output[4]);

msg.out5 = parseInt(output[5]);

msg.out6 = parseInt(output[6]);

msg.out7 = parseInt(output[7]);

?

?

if (msg.out0 === 1){

msg1 = {topic: 'relay1',payload:'true'};

} else?

msg1 = {topic: 'relay1',payload:'false'};

?

if (msg.out1 === 1){

msg2 = {topic: 'relay2',payload:'true'};

} else

msg2 = {topic: 'relay2',payload:'false'};

?

if (msg.out2 === 1) {

msg3 = {topic: 'relay3',payload:'true'};

} else

msg3 = {topic: 'relay3',payload:'false'};

?

if (msg.out3 === 1) {

msg4 = {topic: 'relay4',payload:'true'};

} else

msg4 = {topic: 'relay4',payload:'false'};

?

if (msg.out4 === 1) {

msg5 = {topic: 'relay5',payload:'true'};? ??

} else

msg5 = {topic: 'relay5',payload:'false'};

?

if (msg.out5 === 1) {

msg6 = {topic: 'relay6',payload:'true'};

} else

msg6 = {topic: 'relay6',payload:'false'};

?

if (msg.out6 === 1) {

msg7 = {topic: 'relay7',payload:'true'};? ??

} else

msg7 = {topic: 'relay7',payload:'false'};

?

if (msg.out7 === 1) {

msg8 = {topic: 'relay8',payload:'true'};

} else

msg8 = {topic: 'relay8',payload:'false'};

?

node.send(msg1);

node.send(msg2);

node.send(msg3);

node.send(msg4);

node.send(msg5);

node.send(msg6);

node.send(msg7);

node.send(msg8);

?

return;

?

?

?

Join [email protected] to automatically receive all group messages.