In an attempt to reuse code I am trying to use dynamic variables to test a condition but am unable to get the result I need. I'm using delayed expansion.
1 Outside the for loop:
2 set "H_HEADER=FALSE"
3 set "SUB_TRANSTYPE=#"
4
5 Inside the for loop:
6 set "SUB_TRANSTYPE=!FULL_LINE:~0,1!"
7 if !SUB_TRANSTYPE!==H (
8 echo sub_transtype_header is !!SUB_TRANSTYPE!_HEADER!
9 )
Line 6 sets SUB_TRANSTYPE to H
Line 8 prints H_HEADER to console but I want it to print FALSE (the value of H_HEADER)
I've messed around with escape characters but can't get this to work. Help!