On 13.07.15 10:29, Marcus Bowman wrote: > Being basically lazy, I often assemble programs from skeletons, and > add bits copied from text files or previously-saved code. I invariably > forget to renumber REPEAT loop references, so I end up with more than > one loop with the same reference number (like O500 REPEAT etc in 2 or > 3 places) When I load the program, LinuxCNC gets stuck in an endless > attempt to resolve the loop references. > > Is there a simple way to halt this? I can't find anything other than > shutting down LinuxCNC, and its a pain. Is there a keystroke > combination to force the program to stop?
In the short term, would a few lines of awk, to scan the program for that no-no, be useful? (Or forgotten in the rush to make swarf?) It would be nearly as easy to have it change any repetition to another number, and ensure that it is unique in the program. In the longer term, what about tweaking the interpreter code to only look forwards for the first matching "endrepeat"? Even if it builds a set of pointers to all of them in an initial pass, that process could readily save the first following match only, I figure. That way, the Oxxx label could be freely re-used on non-nested "repeat" statements. (Anyone using the same label on nested loops deserves whatever happens, I suspect.) Erik -- Programs must be written for people to read, and only incidentally for machines to execute. - Abelson and Sussman ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users