3 of 3 people found this helpful
Sometimes you must be exact with "No Data" instead of "no data". But there are better ways to make your code less prone to break.
First, you could be using the AFSystemStateCode.NoData enumeration instead of the literal "No Data" strings. It makes your intent clear and avoids any capitalization issues. The enumeration is an equivalent of the digital state (code + text), whereas "No Data" is just the text portion.
I suggest you read the Remarks section of the AFAttribute.SetValue method. Additionally, you may consider using the AFData.UpdateValue method. In either case, you would still want to use the AFSystemStateCode.NoData enumeration or the AFValue.CreateSystemNoDataFound or AFValue.CreateSystemStateValue methods.
Going back to your stated problem of SetValue, let's assume you have variables named "attr" and "timestamp". Then you could try:
I am a personal fan of the first way since one day I may decide to use another digital state. All of would have to specify is another AFSystemStateCode enumerated value.