Search Results for

    Show / Hide Table of Contents

    TCellValue Record

    Represents a value inside a cell.

    Syntax

    Unit: FlexCel.Core

    TCellValue = record;

    Methods

    Name Description
    Empty Creates a cell value without value.
    Create Overloaded
    Create(Double)
    Create(Int64)
    Create(TDateTime)
    Create(string)
    Create(TRichString)
    Create(Boolean)
    Create(TFlxFormulaErrorValue)
    Create(TFormula)
    Create(Variant)
    Create(TValue)
    IsEmpty Returns true if the cell is empty.
    HasValue Returns true if the cell has a value. This is the opposite of IsEmpty
    IsNumber Returns true if the cell contains a number. Note that cells with dates will be reported as Number too.
    IsDateTime Returns true if the value is a DateTime.
    Note::This value will never be true when reading cells from a file.
    When reading a file, dates are stored as number so they will be returned as numbers.
    This property only will return true if you manually created a TCellValue from a TDateTime.

    To know if a cell has a date, you need to look at its format, not its value.
    IsString Returns true if the cell has a string.
    IsBoolean Returns true if the cell has a boolean.
    IsError Returns true if the cell has an error like #N/A! or #DIV0!.
    Note that this only applies to error values entered directly in the cell.
    If the cell has a formula that returns #N/A!, then the cell has a formula and the formula has an error. But the cell itself doesn't have an error.
    IsFormula Returns true if the cell has a formula.
    AsNumber Returns the value of the cell if it contains a number or a date.
    If the cell doesn't contain a number this method will raise an exception so you might want to check first the cell data type before calling it.
    AsDateTime If the cell contains a datetime, it returns the value. If not, it raises an Exception. Remember that cells returned from a file will never have a datetime, they will have numbers instead.
    AsString If the cell contains a string, it returns the string. If not, it raises an Exception. To get a string with whatever value is in the class, use ToString
    ToString Returns a rich string with whatever the cell value is. If this is an integer or a boolean, it will be converted to a string.
    ToSimpleString Returns a string without formatting. This is equivalent to ToString.ToString, but it can be faster.
    ToStringInvariant Returns a string with whatever the cell value is. If this is number, it will be converted to a string, using invariant format settings (decimal separator will always be "." for example).
    ToDateTime Returns the value as a DateTime, if it can be converted, or DateTime(0) if it can't.
    ToNumberInvariant Returns the value as a number, if it can be converted, or 0 if it can't. Note that this conversion uses invariant culture so even if your decimal separator is ",", the strings converted should be like "2.0"
    AsBoolean If the cell contains a boolean, it returns the value. If not, it raises an exception.
    AsError If the cell contains an error, it returns the value. If not, it raises an exception.
    AsFormula If the cell contains a formula, it returns the value. If not, it raises an exception.
    AsVariant Returns the cell value as a variant.
    AsTValue Returns the cell value as a TValue.
    ClearValue Sets the value of the cell to empty.

    Operators

    Name Description
    Implicit Conversion Overloaded
    Implicit conversion from Double to TCellValue
    Implicit conversion from TCellValue to Double
    Implicit conversion from Extended to TCellValue
    Implicit conversion from TCellValue to Extended
    Implicit conversion from Integer to TCellValue
    Implicit conversion from TCellValue to Integer
    Implicit conversion from Int64 to TCellValue
    Implicit conversion from TCellValue to Int64
    Implicit conversion from TDateTime to TCellValue
    Implicit conversion from TCellValue to TDateTime
    Implicit conversion from string to TCellValue
    Implicit conversion from TCellValue to string
    Implicit conversion from TRichString to TCellValue
    Implicit conversion from TCellValue to TRichString
    Implicit conversion from Boolean to TCellValue
    Implicit conversion from TCellValue to Boolean
    Implicit conversion from TFlxFormulaErrorValue to TCellValue
    Implicit conversion from TCellValue to TFlxFormulaErrorValue
    Implicit conversion from TFormula to TCellValue
    Implicit conversion from TCellValue to TFormula
    Implicit conversion from TSingleFormulaValue to TCellValue
    Implicit conversion from TCellValue to TSingleFormulaValue
    Implicit conversion from TFormulaValue to TCellValue
    Implicit conversion from TCellValue to TFormulaValue
    Implicit conversion from Variant to TCellValue
    Implicit conversion from TCellValue to Variant
    Implicit conversion from TValue to TCellValue
    Implicit conversion from TCellValue to TValue
    Equality Adapts the = operator so it returns true when both instances have the same values.
    Inequality Adapts the <> operator so it returns true when both instances have different values.

    Properties

    Name Description
    ValueType Data type of the cell. All the properties like IsNumber check this ValueType to know what the cell contains.
    In This Article
    Back to top FlexCel Studio for VCL and FireMonkey v7.8.0
    © 2002 - 2020 tmssoftware.com