Macro overflow

I have a macro that works for D=10, 20, 30, 40, and 50. I can see it taking longer and longer as I increase D. When I put D=55 it just stops.

The macro is structured like this:
While i<D { ForEach{ Execute Macro { Repeat x times} } }

Is it failing at D=55 because my computer can't handle it, or is it KM can't handle it? Or is it a nesting problem?

It is working only with text files.

Thank you,


Have you tried the KM debugger? If you open the debugger you can execute the macro step by step to see where and why it's stopping. That's what I do every day to solve problems like this.

Does it stop with an error or without any error? The phrase "it just stops" could mean either.

You could also put certain kinds of statements so that you know if the program is reaching a certain point. For example the last statement of your macro could play a sound. I do this a lot to see if the program just finished early or if it failed at all. More often I put a Speak Text action in various places and I have it say things like "reached start of loop" and "finished loop", etc.

Many actions have options in the cogwheel to enable or disable error reporting. Have you ever changed those settings? If so that could be a direct result of your custom settings.

Is it a recursive macro? You haven't really shown what your macro does. If it's recursive, there's a maximum number of times you can recurse in depth before the KM engine stops all macros. I think the number is 25. KM will stop without warning, so it would behave similarly to how you are describing.

When you say it just stops, did you validate that it actually stopped using the debugger, or does it just stop displaying any output? E.g., could it be in an invite loop. There's not enough information in your question for me to tell.

Obviously you don't have to show your code. Perhaps you can trim your code down and remove items you don't want us to see like variable names. One thing I often do to debug is trim my program down to the shortest program that can still fail. By doing that I narrow down the probable cause and sometimes I can solve the problem on my own that way.

Those are my ideas based on the information you provided.

Strangely enough, everything was fixed when I added an extra column and extra row to the csv files the macro was calling. Who knows.

I love it when that happens, cause I still get credit. Just kidding. There's no credit here.

@R_B_Jawad, glad you solved your own problem.
For the future, we would need to you upload your macro in order for us to be of much help.