dpboyer

dpboyer

  • NA
  • 3
  • 0

Assigning values to members of a struct in an arraylist

Mar 31 2005 7:04 PM
I have the following code: foreach(DCPoint tPoint in tSample.Data) { tPoint.Dye1Derivative = Convert.ToDouble(subStrings[i]); i++; } which refers to a struct (which is held in an arraylist (tSample.Data) in a class (of which tSample is an instance)): public struct DCPoint { public double Temperature; public double Dye1Derivative; public double Dye2Derivative; } the line (from above): tPoint.Dye1Derivative = Convert.ToDouble(subStrings[i]); keeps generating the following error: The left-hand side of an assignment must be a variable, property or indexer It looks like a variable to me so I don't understand why I'm generating the error... anyone know what I am doing wrong? Thanks, Daniel Reply With Quote

Answers (3)