Expected wave name, variable name, or operation

function overhead(basewave)
	
	string basewave
	wave baswav = $basewave
	string New, raw5, raw6, raw7, raw
	variable col, chan, w5, w6, w7
	variable colnum = (numpnts(baswav)/8)
	
	raw5 = "L_eventCounter_; L_fullInt_; L_fracInt_; L_typ_"
	raw6 =  "Nt_eventCounter_; Nt_fullInt_; Nt_fracInt_; Nt_typ_"
	raw7 = "Nb_eventCounter_; Nb_fullInt_; Nb_fracInt_; Nb_typ_"
	
	w5 = StringMatch(basewave, "b0w5_e*")
	w6 = StringMatch(basewave, "b0w6_e*")
	w7 = StringMatch(basewave, "b0w7_e*")

	if (w5 == 1)
		raw = raw5
	elseif (w6 == 1)
		raw = raw6
	elseif (w7 == 1)
		raw = raw7
	endif
	
	for (col = 1; col < 4; col += 1)
		New = StringFromList(col, raw)
		Duplicate /R = (0, colnum) (col, col), baswav, $New
		appendtotable $New
	endfor

end

Hi I'm getting the error of expected wave name, variable name or operation when I try to initiate this particular function.  I even give it existing wave names, but I get the same error message.

 

Thanks in advance.

 

I believe the problem is with the spaces in your lists. When you do StringFromList, you will get a  space in New. So either removing spaces, or putting "; " as your delimiter in the StringFromList should solve it.

 

ken