How can I send "else do nothing"?

60 views
Skip to first unread message

Klaus

unread,
Aug 4, 2014, 12:21:08 PM8/4/14
to comman...@googlegroups.com
Command value in a feedback process:

{{if([@d20]==1,2,do_nothing)}}

(if digital join 20 is 1, then send value 2, else do nothing)
How can I express this?

Klaus

Barry Gordon

unread,
Aug 4, 2014, 12:32:10 PM8/4/14
to comman...@googlegroups.com

How about:

 

if([@d20]==1)  sendValue(2) 

 

or perhaps just:

 

 if(d20==1) sendValue(2);

 

Assuming there is a send value function as I am not sure of the context in which you want to do this

--
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commandfusio...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jarrod Bell

unread,
Aug 4, 2014, 7:56:13 PM8/4/14
to comman...@googlegroups.com
Math expressions can only result in numerical values that are sent when the command is fired. You cannot make a "send or not send" decision using math expressions.

Instead, you would need to use some JavaScript.
In the command value, put simply this: [@d20]
Then tick the "javascript sends command" option.
Then in your JS do this:
if (data == 1) CF.send(system, "2");

More info on the "Command send handler" context is here:
http://commandfusion.com/docs/scripting/startup.html#command_send_handler

Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


Klaus

unread,
Aug 5, 2014, 4:47:52 PM8/5/14
to comman...@googlegroups.com
Great! Thanks!

Klaus
Reply all
Reply to author
Forward
0 new messages