Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to save a float value in to a variable (float) property?
    text
    copied!<p>Gurus,</p> <p>Appreciate if some one guide me over it.</p> <p>I am trying to save a floating point values (from a Float[] array) to a variable property (of type float), but I am not able to save it correctly. Everytime I want to save a new value, the variable property never accepts the new value and keep retaining the intialized value only. Here I am trying to save value,</p> <p>CommandLineVariables.PiSenseResistor = tempFloatArray[0];</p> <p>Where, CommandLineVariables is the class name PiSenseResistor is the variable property tempFloatArray is the float array from which I want to save value</p> <p>I tried many times using single stepping and watching the variable property value, but always after the execution of the above mentioned instruction, it shows the initialized value only.</p> <p>The same thing I am doing with other variable properties as well and they are working correctly.Wondering What wrong am I doing with this saving of floating point number into variable property.</p> <p>Appreciate help.</p> <p>Edited*<strong><em>*</em>**<em>*</em>**<em>*</em>***</strong></p> <p>Adding some extract of the code for easy reference,</p> <pre><code>//variable initialization private static float piOffsetPressure = 1.01295f; //Property definition for the variable public float PiOffsetPressure { get { return piOffsetPressure; } set { piOffsetPressure = value; } } </code></pre> <p>&nbsp;</p> <pre><code>//Copy the parameter value into its corresponding property if (!Convert.ToBoolean(ReturnCode)) { CommandLineVariables.PiOffsetPressure = tempFloatArray[0]; CommandLineVariables.PdOffsetPressure = tempFloatArray[1]; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload