Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

How to stop processing macro on varible matching value?

If you have a question or need help, this is the place to be.
Post Reply
PaulBags
Posts: 14
Joined: Fri Oct 21, 2016 2:49 am

How to stop processing macro on varible matching value?

Post by PaulBags »

Why doesn't this work as a python command?: eg.plugins.EventGhost.StopProcessing() if eg.globals.ftp_status== 'Up' else plugins.EventGhost.DoNothing()
It test ok but doesn't actually stop the macro.

For now I guess I'll duplicate the test and jump to a null macro without return, but it would be easier to be able to stop on variables and only have the test command in one place if the command ever needs updating.
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: How to stop processing macro on varible matching value?

Post by kgschlosser »

Your syntax is all out of sorts. And if you don't want to do anything then just let it ride on by because it didn't match the if statement. It won't stop the macro. Below is the proper syntax watch out for the 4 spaces after the if statement. That is the marker in Python that the code below the if gets processed as part of the if statement

Code: Select all

if eg.globals.ftp_status == 'Up':
    eg.plugins.EventGhost.StopProcessing()
If you like the work I have been doing then feel free to Image
PaulBags
Posts: 14
Joined: Fri Oct 21, 2016 2:49 am

Re: How to stop processing macro on varible matching value?

Post by PaulBags »

Cheers :)
Post Reply