I'm stumped with the syntax for the following scenario:
I'm trying to get i to step through the months and to plug amounts into Jan_amt, Feb_amt as string(i)_amt depending on what month it is on.
I'm trying to get i to step through the months and to plug amounts into Jan_amt, Feb_amt as string(i)_amt depending on what month it is on.
Code:
var
Jan_amt,Feb_amt,Mar_amt,Apr_amt,May_amt,Jun_amt,
Jul_amt,Aug_amt,Sep_amt,Oct_amt,Nov_amt,Dec_amt string
endVar
for i from 1 to 12
switch
case i = 1:stMonth = "JAN"
case i = 2:stMonth = "FEB"
case i = 3:stMonth = "MAR"
case i = 4:stMonth = "APR"
case i = 5:stMonth = "MAY"
case i = 6:stMonth = "JUN"
case i = 7:stMonth = "JUL"
case i = 8:stMonth = "AUG"
case i = 9:stMonth = "SEP"
case i = 10:stMonth = "OCT"
case i = 11:stMonth = "NOV"
case i = 12:stMonth = "DEC"
endSwitch
endFor
string(i)+"_amt" = wmsTC.stMonth ;// ** <----
switch
case string(i)+"_amt" = "2.50": stMonth+"_SN" = 1
case string(i)+"_amt" = "3.35": stMonth+"_DB" = 1
endSwitch