I have 2 modules that will convert code into strings, module1.jq and module2.jq
module1 converts the code of obj1 that have this form
{ “code1″:”254”, “Object2s”:[ {Object2}, {Object2} ] }
module2 converts the code of obj2 that have this form
{ “code1″:”574”, “Object1s”:[ {Object1}, {Object1} ] }
As you can see, both object include each other, so in module1 it will be a statement
include “module2”;
and in module2 there will be an statement
include “module1”;
when using either of the modules, you´ll get an infinite loop.
module3.jq
include “module1”;
How can stop this from happening?
Any help will be apreciated
I try to define kind of variables unique for each module and go like
In module1.jq
$module_module1 = 1;
if $module_module2 == 0 then include “module2”;
In module2
$module_module2 = 1;
if $module_module1 == 0 then include “module1”;
but it did not work.
canario is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.