has element

From DavinciWiki
Jump to: navigation, search


Description

Determines if a structure contains an element of a specific name

Arguments and Return Values

Arguments: A struct and a string

Return Value: 0/1

Usage

Syntax: has_element(object = STRUCT, element = STRING)

if object is not a STRUCT, has_element() will return a 0 just as if it was a struct without the specified element. If you want to specifically check if object is a struct use format().

Examples

dv> s
struct, 4 elements
    ele1: 12345
    ele2: 67890
    ele3: 11121
    ele4: 31415

dv> has_element(s, element="bob")
0

dv> has_element(s, "ele4")
1

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Related Functions

Recent Core Changes

Modified On: 05-14-2013

Personal tools