Page 1 of 1

Error in nested loops

Posted: Thu Oct 19, 2017 3:52 pm
by ddsswick
Hi,

I get the following error when I run a macro. I do not have 2 loops in that macro. But I have 2 'obey' functions. Is it why I do get this error? I am very grateful if someone can help. This only occurs after few loops in the main macro worked well.

error while obeying batch file D:\****\***\Codes\code5.txt at line number 1:
loop b306 1 B30

nested loops must be in seperate obey files


Thank you very much....

Re: Error in nested loops

Posted: Thu Oct 19, 2017 4:29 pm
by ChrisCharlton
The shouldn't be a limitation on the number of calls to obey that you can make within a macro. If you could provide a simplified example that demonstrates the problem then I will investigate this further.

Re: Error in nested loops

Posted: Thu Oct 19, 2017 11:08 pm
by ddsswick
ChrisCharlton wrote: Thu Oct 19, 2017 4:29 pm The shouldn't be a limitation on the number of calls to obey that you can make within a macro. If you could provide a simplified example that demonstrates the problem then I will investigate this further.
Say, I have the main code as 'code1'. Inside that there is an obey command to call 'code2'. Inside 'code2' also there are two obey commands that call 'code3' and 'code4'. When I run 'code1', after some iterations I get this error. The error shows in the loop command in 'code4'.

I am very much thankful if you could help...

Re: Error in nested loops

Posted: Fri Oct 20, 2017 9:00 am
by ChrisCharlton
I tried to replicate the error with the following macros:

code1.txt:

Code: Select all

SAY "inside code1"
LOOP b1000 1 10000
  OBEY "code2.txt"
ENDLOOP
code2.txt:

Code: Select all

SAY "inside code2"
OBEY "code3.txt"
OBEY "code4.txt"
code3.txt:

Code: Select all

SAY "inside code3"
code4.txt:

Code: Select all

SAY "inside code4"
However I did not get the error that you are seeing.

Re: Error in nested loops

Posted: Fri Oct 20, 2017 12:12 pm
by ddsswick
ChrisCharlton wrote: Fri Oct 20, 2017 9:00 am I tried to replicate the error with the following macros:

code1.txt:

Code: Select all

SAY "inside code1"
LOOP b1000 1 10000
  OBEY "code2.txt"
ENDLOOP
code2.txt:

Code: Select all

SAY "inside code2"
OBEY "code3.txt"
OBEY "code4.txt"
code3.txt:

Code: Select all

SAY "inside code3"
code4.txt:

Code: Select all

SAY "inside code4"
However I did not get the error that you are seeing.
I tired changing few values inside the code. Now the error is not coming.
Thank you very much for taking your time for this.

Re: Error in nested loops

Posted: Wed Dec 13, 2017 2:20 am
by namphan1998
Keep up the good work ddsswick

You're dedicated to this site!!

Im also looking for this!!