I am trying to write a short batch file that will change a few variables each time it loops. I am just having a lot of trouble with the "set /a" assignment statements. If someone could please outline the correct syntax for the set statement and/or suggest how I could correct my code it would be greatly appreciated...
Thanks, Nathan
rem echo off
set mFourMIN=0.0
set mFourMAX=3.0
rem set umMIN=0.0
rem set umMAX=1.0
rem set phiMIN=0.0
rem set phiMAX=10
set mFour=0.0
FOR /L %%G IN (%mFourMIN%,1,%mFourMAX%) DO (
echo mFour = %mFour%
rem SET um=1
rem SET phi=10
SET /a tope = %mFour% - 1
SET /a tope = %tope% * 9
SET /a bote = %mFour% + 1
SET /a bote = %bote% * 10
SET /a e = tope / bote
echo e = %e%
echo e = %e%
rem set outFile="e%e%_umass%um%_phi%phi%.d"
rem echo outFile = %outFile%
rem ..\..\gawk\gawk "BEGIN { ORS = \"\n\"; } {if (NR == 7) { print \"\tmFourVal=%mFour%\" >> \"tmpsetupFile\"; next } if (NR == 8) { print \"\tumassVal=%um%\" >> \"tmpsetupFile\"; next } if (NR == 9) { print \"\tphiVal=%phi%\" >> \"tmpsetupFile\"; next } else { print $0 >> \"tmpsetupFile\" } }" setupFile
rem ..\..\gawk\gawk -f tmpsetupFile source.d
SET /a mFour= %mFour% + 1
echo.
)
PAUSE
This post has been edited by enpey: 13 January 2008 - 09:41 PM

New Topic/Question
Reply




MultiQuote




|