Thomas, your macro seems to work. However, being a nitpicker, there is one thing...
Sub Main()
'ask Operator to enable output
Response = MsGBox ("Do you realy want to enable Output 1?" , 4)
'Yes has been pressed
If Response = 6 then
ActivateSignal(OUTPUT1)
'Abort has been pressed
Else
GoTo Ende
End If
'ask Operator to disable output
Response = MsGBox ("Do you realy want to disable Output 1?" , 4)
'Yes has been pressed
If Response = 6 then
DeActivateSignal(OUTPUT1)
'Abort has been pressed
Else
GoTo Ende
End If
Ende:
End Sub
If you answer to the first question (do you want to enable output1) yes, the output is activated.
Then if you answer no to the 2nd question (do you want to disable), the dialog box disappears and output remains active. So far so good.
But then if I finally want to disable output and I press the button created for the output control, I get the first message again and it asks to enable even the output is already enabled.
So how to modify macro that it jump to the second question right away if output is already activated when you hit the button?
Sub Main()
[color=red]If OUTPUT1 =Active then goto dude[/color]
'ask Operator to enable output
Response = MsGBox ("Do you realy want to enable Output 1?" , 4)
'Yes has been pressed
If Response = 6 then
ActivateSignal(OUTPUT1)
'Abort has been pressed
Else
GoTo Ende
End If
[color=red]dude[/color]
'ask Operator to disable output
Response = MsGBox ("Do you realy want to disable Output 1?" , 4)
'Yes has been pressed
If Response = 6 then
DeActivateSignal(OUTPUT1)
'Abort has been pressed
Else
GoTo Ende
End If
Ende:
End Sub
How to code what I've tried to explain in red text?
Ok, it seems that the coloring does not work in the code section, but you can see what I am explainin there in between color brackets [ ]
Cheers,
Juha