-1

I am trying to figure out how to change the stroke color of a text field if the value is changed from what the current value is. For these fields i have values that are automatically pulled from various sources and inputted into an XML form. The values are all numeric as well. I want to write something that will say "if the value changes, print the stroke color in different color" but am not sure how to do so. My feeble attempt so far is below. Not sure what additonal info anyone would need to help but please ask and i will answer if needed.

v = FormSet.GetFieldValue(CurrentForm, "IMPR_ROOMS_TOT_BEDROOMS")
if v != v 
    FormSet.SetObjectPRoperty(CurrentForm, "IMPR_ROOMS_TOT_BEDROOMS", "StrokeColor", "#f11818")
wondergoat77
  • 1,765
  • 9
  • 32
  • 60
  • Framework? Or in other words: What the heck is a `FormSet`? – Lukas Graf Sep 26 '12 at 19:40
  • framework 4.0,, formset is referring to an XML form that was built to handle calculations in its fields. So the field IMPR... is a numeric field in the form. hope that helps – wondergoat77 Sep 26 '12 at 19:52
  • 4.0? I meant what framework are you using? This is not plain Python, you must be using something else. Django maybe? – Lukas Graf Sep 26 '12 at 19:54
  • its within a .net application, the .net framework its using is v 4.0 – wondergoat77 Sep 26 '12 at 20:00
  • i know im getting downvoted for something, can someone help me find out why? so i can ask better questions in the future – wondergoat77 Sep 26 '12 at 20:15
  • 1
    A couple points: 1) Your code snippet contains a syntax error (missing `:` on the second line. This means you haven't copy pasted the code from a running example. 2) Your questions tags say `python`, but you're telling me it's `.net`? Which is it? Explain the details of the framework(s) you're using _in the question_ (not the comments) and tag it correctly. 3) You're not providing enough context. Without knowing what kind of object `FormSet` is, how should people be able to know what `SetObjectPRoperty` does? – Lukas Graf Sep 26 '12 at 20:27
  • thanks, i didnt even know i was doing those things wrong, still a newb in coding. but i appreciate the feedback and will try to be more specific in the future. I honestly dont know what the true language of this is. I do know it is a .net application which uses python in it, again not exactly sure how but it does. thanks for the help. – wondergoat77 Sep 27 '12 at 18:17

1 Answers1

2

Your comparison will never be true. v will never be not equal to v, so your code to set the property will never fire.

Paul McNett
  • 847
  • 6
  • 9