Blackbird Posted December 2, 2015 Posted December 2, 2015 Can you use the "Repeat" command in a program, to only repeat the line above it or does it repeat all lines within the "then" group? For example when I close my back door I want a few lights to go out but sometimes they don't always go out so I wanted to only repeat the porch light turning off. Thanks
LeeG Posted December 2, 2015 Posted December 2, 2015 The statement(s) after the Repeat until next Repeat Then .... Repeat 3 times Set 'ICON Relay 2' Off Repeat 1 times Else
Blackbird Posted December 2, 2015 Author Posted December 2, 2015 What would happen without the "repeat 1 time" line?
LeeG Posted December 2, 2015 Posted December 2, 2015 The Repeat 1 time ends the Repeat loop above. It allows other statements to be coded after the Repeat 1 time that do not participate in the Repeat 3 times loop.
stusviews Posted December 2, 2015 Posted December 2, 2015 Since the topic is about the command itself, I'll add the placing one or more statements between Repeat 0 times and Repeat 1 time has the same effect as REMing those statements. The ISY does not provide a REM command. Great for troubleshooting a program. 1
LeeG Posted December 2, 2015 Posted December 2, 2015 Perhaps that was not the question. All statements after Repeat 3 times to end of clause are in the Repeat 3 times loop. Then .... Repeat 3 times Set 'ICON Relay 2' Off .... .... Else The Repeat statement is covered in the Wiki http://wiki.universal-devices.com/index.php?title=ISY-99i/ISY-26_INSTEON:Action
Blackbird Posted December 2, 2015 Author Posted December 2, 2015 So in your example above? If I just use the repeat 3 line then a command and nothing else, it would repeat that command. If I had another line after the one I wanted repeated, I need to put repeat 1 then a new command?
LeeG Posted December 2, 2015 Posted December 2, 2015 (edited) The Repeat range is to the end of the clause (Then or Else), or to the next Repeat. In this example the Set, and all statements after that are repeated Then .... Repeat 3 times Set 'ICON Relay 2' Off statement 1 statement 2 Else In this example the Set is the only statement that is repeated Then .... Repeat 3 times Set 'ICON Relay 2' Off Repeat 1 time statement 1 statement 2 Else Edited December 2, 2015 by LeeG
stusviews Posted December 2, 2015 Posted December 2, 2015 Perhaps that was not the question. I thought I made it clear that I was referring to the topic, specifically, Question about the repeat command Since the topic is about the command itself ... I guess I wasn't specific enough. Lee, you are correct. I should not be so terse
LeeG Posted December 2, 2015 Posted December 2, 2015 (edited) Stu My post was in response to Blackbird question. Edited December 2, 2015 by LeeG
ggdowski Posted May 3, 2017 Posted May 3, 2017 Old topic... but one I had to look up. Can I just say that ending a repeat loop with a repeat statement is NOT intuitive.
rccoleman Posted May 3, 2017 Posted May 3, 2017 Old topic... but one I had to look up. Can I just say that ending a repeat loop with a repeat statement is NOT intuitive. Agreed
apostolakisl Posted May 3, 2017 Posted May 3, 2017 Agreed NO doubt. But once learned is not forgotten.
ggdowski Posted May 4, 2017 Posted May 4, 2017 Perhaps. But if you want to truly dishearten a customer, you develop tools that frustrate them for hours because of something that isn't consistent with almost every programming language out there. The syntax looks more like a workaround.
larryllix Posted May 4, 2017 Posted May 4, 2017 Just your old fashioned "repeat until" loop that's been around for many years. Fairly standard, only with a few different words. The until is just repeat 1 (once). Totally intuitive, but intuitive is only relative to your experience. We weren't born programming via a keyboard. QWERTY? Really? I have used many different styles of languages. There is no "intuitive". There is no standard style of repeat. The admin console even indents the contents for you so you now where it begins and ends (even without those words Mr. Pascal). That is way past where I started programming. Now for the syntax quirk. You should love this one. ..."Repeat 1 times" doesn't repeat the loop at all. It only executes it once. Have a good one!
apostolakisl Posted May 4, 2017 Posted May 4, 2017 If UD just put a note there that said "to end repeat, select repeat 1 times" that would take care of it.
larryllix Posted May 4, 2017 Posted May 4, 2017 If UD just put a note there that said "to end repeat, select repeat 1 times" that would take care of it. Add an "end" to the pulldown menu list of times was suggested before. Repeat X times ...do something Repeat End Like any other language you have to learn the syntax and then use it.
apostolakisl Posted May 4, 2017 Posted May 4, 2017 Add an "end" to the pulldown menu list of times was suggested before. Repeat X times ...do something Repeat End Like any other language you have to learn the syntax and then use it. If you are going to do that, I would put it in the pull down column that includes the "for/while/etc".
larryllix Posted May 4, 2017 Posted May 4, 2017 If you are going to do that, I would put it in the pull down column that includes the "for/while/etc". Sure, but I am waiting for logic line enable trigger options first, well at least for a repeating while
apostolakisl Posted May 4, 2017 Posted May 4, 2017 Sure, but I am waiting for logic line enable trigger options first, well at least for a repeating while I'm not sure what you mean. But "repeat while" is an option, I believe this is a new option in the 5.x It includes integer variables as options for repeat while, so I guess it actively checks with each cycle?
larryllix Posted May 4, 2017 Posted May 4, 2017 (edited) I'm not sure what you mean. But "repeat while" is an option, I believe this is a new option in the 5.x It includes integer variables as options for repeat while, so I guess it actively checks with each cycle? It was an attempt at a pundle. I thought you would be right on top of V5. Have a look as this usage for the repeat while.... http://forum.universal-devices.com/topic/18921-v5-averaging-using-only-the-best-values/ Edited May 4, 2017 by larryllix
ggdowski Posted May 5, 2017 Posted May 5, 2017 Glad to add a little humor into a thread. Still stay not intuitive even compared to assembly language on a Pdp-11. Plenty of experience here. Sent from my iPhone using Tapatalk 5x is not an option until it is released. Sent from my iPhone using Tapatalk
larryllix Posted May 5, 2017 Posted May 5, 2017 Glad to add a little humor into a thread. Still stay not intuitive even compared to assembly language on a Pdp-11. Plenty of experience here. Sent from my iPhone using Tapatalk 5x is not an option until it is released. Sent from my iPhone using Tapatalk PDP-11? No PDP-8? Just a newbie!
Bumbershoot Posted May 5, 2017 Posted May 5, 2017 Okay, this thread has me a little confused. I wrote this little program to demonstrate my question. I want to water in some grass seed on the back lawn that suffered some winter/dog damage. Is there a way, within this program, to have the repeat clause reevaluate the conditions in the "if" statement prior to each repeat cycle (the climate module stuff is dynamic and would optimally be reevaluated each time the program repeats)? I was fairly certain that the "if" clause isn't reevaluated with each repeat cycle, but suddenly I'm unsure about that. Normally, I'd use one program to call other programs based on values from the climate module to accomplish this. Is that correct? BackLawnReSeed - [ID 008A][Parent 0089] If From 7:00:00AM on 2017/05/05 To 10:00:00PM on 2017/05/20 And ( From Sunrise + 4 hours To Sunset - 1 hour (same day) And ( Module 'Climate' Temperature > 50 °F And Module 'Climate' Total Rain Today < 0.2 " And Module 'Climate' Wind Speed < 15 mph ) ) Then Repeat Every 2 hours Set 'Devices / dirNodeServers / RainMachine / RainMachine / Rear Lawn' Start Wait 10 minutes Set 'Devices / dirNodeServers / RainMachine / RainMachine / Rear Lawn' Stop Else - No Actions - (To add one, press 'Action') Thanks in advance. This forum is invaluable!
Recommended Posts