Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String syntax

Status
Not open for further replies.

Steve688

IS-IT--Management
Oct 23, 2002
34
CA
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.

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
 
I noticed a glaring error as soon as I posted.

the string line should be more like:

Code:
strMonth+"_amt" = wmsTC.stMonth
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top