Batch and Variable Scope


Author
Message
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
It is correct that <values> defined in a <batch> script are not accessible by / within the scope of any individual scripts run by the <batch>. Moreover, script properties like the data file location are typically read-only (i.e., they cannot be set at runtime and or determined by variables).

I do not see a way to satisfy your requirements using only <batch> functionality. However, you do not necessarily need to rely on <batch> elements to achieve the desired degree of flexibility and modularity.

Inquisit can also be invoked via the command line (cf. https://www.millisecond.com/support/docs/v5/html/howto/howtocommandline.htm and https://www.millisecond.com/support/docs/v5/html/articles/batchscripts.htm ) and that can be automated via shell scripts or other means to a high degree. The general workflow would then be to have a per-study shell script that:

- Checks for the existence of a study-specific directory (and if none exists, creates it),
- Copies the actual task scripts from the common directory to the study-specific directory, and
- Executes the tasks from there in the desired order / fashion.

Hope this helps.

AndrewJSchoen
AndrewJSchoen
Partner Member (559 reputation)Partner Member (559 reputation)Partner Member (559 reputation)Partner Member (559 reputation)Partner Member (559 reputation)Partner Member (559 reputation)Partner Member (559 reputation)Partner Member (559 reputation)Partner Member (559 reputation)
Group: Forum Members
Posts: 2, Visits: 33
Hi all,

We have a couple different studies in the works in which we are trying to implement Inquisit. I am tasked with recreating our old tasks in your framework. Based on the benefits of modularization with batches, and the fact that many of our studies use identical tasks, but not identical collections of those tasks, I thought I would try to create study-specific batch scripts separate from the tasks. Ideally, I would like to create a directory on our computer with a repository of those tasks, and just point the batch script to the task files as needed. Finally I would like to place the data in a study-specific location, as opposed to a communal dumping ground. 

I had hoped that by defining a value in the batch (output_prefix), that variable file would be available within the scope of the individual file elements, but it looks like it is not the case. Do you have any suggestions on how to get the desired behavior, while maintaining as much modularity as possible (and reducing redundancy)? 

Thanks!
Andy
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search