Run TUFLOW From a Batch-file: Difference between revisions

Content deleted Content added
No edit summary
Line 112:
:: Loop Through
FOR %%a in (%A%) do (
FOR %%b in (%B% %%a) DO (
IF NOT %%a==%%b start "TUFLOW" /wait C:\TUFLOW\releases\2011-09\w64\TUFLOW_iSP_w64.exe -e1 %%a -e2 %%b filename.tcf
)
)
Line 119:
</pre>
In order to test the syntax, you can test the batch file by replacing the following line:<br>
<tt>IF NOT %%a==%%b start "TUFLOW" /wait C:\TUFLOW\releases\2011-09\w64\TUFLOW_iSP_w64.exe -e1 %%a -e2 %%b filename.tcf</tt><br>
With the following line:<br>
<tt>IF NOT %%a==%%b <u>echo</u> start "TUFLOW" /wait C:\TUFLOW\releases\2011-09\w64\TUFLOW_iSP_w64.exe -e1 %%a -e2 %%b filename.tcf</tt><br>
By using the echo in the command line, rather than starting the simulations the command line will be displayed in the DOS output. In the example above the DOS output is shown in the image below.
[[File:DOS nested batch output.png|frame|none]]
 
Alternatively this can be achieved on using the following syntax, which is essentially the same but has the for loops compressed to a single line:
<pre>
@echo off
setlocal
SetLocal
set A=Q010 Q020 Q050 Q100 Q200
for %%1 in (Q010 Q020 Q050 Q100 Q200) do for %%2 in (10min 30min 60min 120min 270min) do start "TUFLOW" /wait C:\TUFLOW\releases\2011-09\w64\TUFLOW_iSP_w64.exe -e1 %%1 -e2 %%2 filename_~e1~_~e2~.tcf
set B=10min 30min 60min 120min 270min
 
forFOR %%1a in (Q010 Q020 Q050 Q100 Q200%A%) do forFOR %%2b in (10min 30min 60min 120min 270min%B%) do start "TUFLOW" /wait C:\TUFLOW\releases\2011-09\w64\TUFLOW_iSP_w64.exe -e1 %%1a -e2 %%2b filename_~e1~_~e2~.tcf
pause
</pre>
Line 135 ⟶ 138:
<pre>
@echo off
setlocal
SetLocal
set A=Q010 Q020 Q050 Q100 Q200
for %%1 in (Q010 Q050 Q100) do for %%2 in (30min 60min 360min) do for %%3 in (exg dev) do echo start "TUFLOW" /wait C:\TUFLOW\releases\2011-09\w64\TUFLOW_iSP_w64.exe -e1 %%1 -e2 %%2 -s1 %%3 filename_~e1~_~e2~_~s1~.tcf
set B=10min 30min 60min 120min 270min
set C=Exg Dev Mit
 
forFOR %%1a in (Q010 Q050 Q100%A%) do forFOR %%2b in (30min 60min 360min%B%) do forFOR %%3c in (exg dev%C%) do echo start "TUFLOW" /wait C:\TUFLOW\releases\2011-09\w64\TUFLOW_iSP_w64.exe -e1 %%1a -e2 %%2b -s1 %%3c filename_~e1~_~e2~_~s1~.tcf
pause
</pre>