andyf0 Posted April 2, 2012 Posted April 2, 2012 After experimenting I find that in order for a folder to be disabled or enabled with a variable, it has to be a state variable. This makes no sense since a state variable would alter the execution of other programs using it. I have some programs that use variables to enable/disable folders but are also used in "If" statements that I would prefer not to be evaluated when I'm just enabling/disabling a folder. I'd like to request that a folder can also be enabled/disabled with an integer variable. Comments? Thanks
apostolakisl Posted April 2, 2012 Posted April 2, 2012 You can use integer variables as part of an if clause for a folder. It just can't be the only item. It will always trigger to true so it would be quite useless. You need to have something else in there. You might say, well I'll force evaluate the folder using a "run if" command from another program, but it would seem that folders can't be run that way. So unless they add the ability force a "run if" command on a folder from another program, there would be no value in ever having an integer varialbe as the only clause of a folder "if".
andyf0 Posted April 2, 2012 Author Posted April 2, 2012 there would be no value in ever having an integer variable (fixed that) as the only clause of a folder "if". I know I'm quoting you out of context but the value is if you have multiple programs you want to disable it is more efficient to disable the folder that contains the programs than to disable each individual program. Not to mention the potential of atomic operations that cannot be re-entered during the disabling of programs. I haven't experimented much with disabling programs vs disabling the folder they are in but it's possible disabling programs allow them to complete when disabled vs stopping them when the folder they are in is disabled. I'm not sure. Also, I believe disabling programs causes writes to the SD card but changing a variable does not. When you do this frequently it matters.
andyf0 Posted April 2, 2012 Author Posted April 2, 2012 You can use integer variables as part of an if clause for a folder. It just can't be the only item. It will always trigger to true so it would be quite useless. Actually, it triggers to the current state of the variable when you create the condition for the folder. True or False. That's the point, if the variable changes it should enable or disable the folder on it's comparason.
LeeG Posted April 2, 2012 Posted April 2, 2012 An Integer variable in general cannot trigger an event as that would break every Program written to the current definition of an Integer variable. Also that would make Integer variables function like State variables defeating the purpose of different types of variables. I understand why a State variable used in Programs would not be used in Folders but it is not clear why a State variable exclusive to Folders could not be used. To the point about the Integer variable affecting Folder Status when the Folder is saved, it is not the variable that is causing the Folder trigger but the Save action.
apostolakisl Posted April 3, 2012 Posted April 3, 2012 I reread my post and I think I might have said something that isn't exactly correct. Integer variables wouldn't always trigger to true, because integer variables don't trigger at all. So if an integer variable were the only clause in a folder condition, nothing would ever change. It would never trigger, becuase integeres by definition don't trigger. Everything else I said still holds. The folder wouldn't always trigger to true, it just would never trigger at all. So I guess ISY technically triggers the folder when it's first saved, but that really is pointless since it would never change after that, since nothing triggers a folder where the only clause is an integer variable. But the point still holds, a folder can have an integer variable, it just needs something else that has the capacity to be a trigger. You can't externally trigger a folder condition, there would not be any point in that. Whatever condition you want to trigger a folder simply gets put into the folder condition.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.