Hello,
I am running several slave do-files using a master do-file, and I am defining locals in the master do-file that are going to be used in the slave do-files. However, this does not work, and when running the master, the locals are not recognize in the slaves do-files. When using global macros, the code did the work. However, I was wondering how safe it is, since global macros are not recommended in general.
See a simple example:
The master do-file would be something like: (of course the real do-files are more complex (and there are several slave do-files, with different sub-tasks each one), and I really need to keep the master & slave structure - you know I don't want to have a do-file with thousands of lines, that would be very difficult to edit and recognize sub-tasks)
The slave do-files would be:
1. example1.do
2. example2.do
When running the master do-file using the locals, they are not recognizing, and the only way to did this is using global macros. I am actually familiar with the difference between local and global macros, however, I was wondering if this kind of use of global is safe in general (since the use of global is not recommended, only if it is absolutely necessary). And If you have any other idea of a different way to do this, they are also welcome! (or maybe I am missing something?)
Thank you!
I am running several slave do-files using a master do-file, and I am defining locals in the master do-file that are going to be used in the slave do-files. However, this does not work, and when running the master, the locals are not recognize in the slaves do-files. When using global macros, the code did the work. However, I was wondering how safe it is, since global macros are not recommended in general.
See a simple example:
The master do-file would be something like: (of course the real do-files are more complex (and there are several slave do-files, with different sub-tasks each one), and I really need to keep the master & slave structure - you know I don't want to have a do-file with thousands of lines, that would be very difficult to edit and recognize sub-tasks)
Code:
local word1 "Hello" local word2 "World" do "example1.do" do "example2.do"
1. example1.do
Code:
dis "`word1'"
Code:
dis "`word2'"
Thank you!
Comment