Machsupport Forum
Mach Discussion => Mach Screens => Screen designer tips and tutorials => Topic started by: krsykes23 on December 13, 2015, 11:47:42 AM
-
Is there a way to 'Execute a Basic Script' to a button, but as a TOGGLE instead of two separate On/Off buttons and two
scripts?
I have a switch that I would like to run my dust extractor with....and I have set the Basic Script to ActivateSignal(OutPut2), which
works fine. But I also need to turn it off...but preferably with the same button!
I guess I cannot do it with one button, but will need a second button to run DeActivateSignal(OutPut2)..??
-
if not isactive then
activate
else
deactivate
end if
-
Hi Gerry,
Thanks for the reply. I've tried the script but get an error! "Error on Line 1 - Argument not Optional"
I have checked that it's correctly spelled. The 'Isactive' doesn't turn blue after I've typed it in the scripter...is that the problem?
This is what I have...
If Not Isactive Then
ActivateSignal(Output2)
Else
DeActivateSignal(Output2)
End If
Apologies for my ignorance...still learning this stuff!
Keith
-
If Not Isactive (Output2) Then
ActivateSignal(Output2)
Else
DeActivateSignal(Output2)
End If
I use similar but this way ...
If IsOutputActive(OUTPUT2) Then
DeActivateSignal(OUTPUT2)
else
ActivateSignal(OUTPUT2)
End if
-
Hi Overloaded....worked a treat. Thanks for the help!