SNumber

Methods and Properties

{Defined in UNIT SNumber.PAS}


The Science Tools Number, SNumber, is derived from the Delphi TEdit class. Unlike TEdit, this object can return a real number. For example to read the double precision real number that is showing on the screen you would use:

Freq:=FreqEdit.Value

If you enter an invalid number into the text field of the object, the background of object will turn red. The user should then enter a new value. You can also use this behavior to indicate that the result of calculation is invalid. For example:

If area<0 then length.Value:=Sqrt(area) else length.Text:=’Imaginary Number’;

The slider has a feature that allows you to tie its value to an SNumber.Value property using the slider’s Delegate property. If the delegate is set then whenever the slider is moved the SNumber will update its view to show the current value of the slider.