difference between Property & index function?

What is the key difference between the property() & index() function?Can anybody tell?

  Discussion posts and replies are publicly visible

Parents
  • Hi devanshum,
    index( array, index, [default] ): Returns array [index] if it is valid else returns default value.
    For example:index({10, 20, 30}, 2, 1) returns 20.
    Retrieving the value of a CDT field using the field name as the index argument: index(topaginginfo(1, 10), "startIndex", 0) -Returns 1

    property( msg!properties, nameOfProperty, [valueIfMissing] ): Returns anytype
    For Example: property(msg!properties,"someStringProperty","Missing Text") -Returns "Missing text" if some string property doesn't exist.

    Thanks,
    ravalik
Reply
  • Hi devanshum,
    index( array, index, [default] ): Returns array [index] if it is valid else returns default value.
    For example:index({10, 20, 30}, 2, 1) returns 20.
    Retrieving the value of a CDT field using the field name as the index argument: index(topaginginfo(1, 10), "startIndex", 0) -Returns 1

    property( msg!properties, nameOfProperty, [valueIfMissing] ): Returns anytype
    For Example: property(msg!properties,"someStringProperty","Missing Text") -Returns "Missing text" if some string property doesn't exist.

    Thanks,
    ravalik
Children
No Data