equals

From DavinciWiki
Jump to: navigation, search


64-bit SafeYes

Description

Determine if two objects are the same

Arguments and Return Values

Arguments: Any davinci object

Return Value: 0 or 1

Usage

Syntax: equals(obj1, obj2)

The equals() function checks every piece of obj1 and obj2 to see if the two objects are identical. This works for VALs, STRINGs, TEXTs and Structures.

Equals() returns 1 if the two objects are identical, and 0 if not.

Prior to davinci 2.18, equals() compared struct members solely by index, not name, so even if 2 structures had identical named members with identical content, if they were in a different order they were unequal. Now, as of 2.18, if both structures have no unnamed members (yes that's possible; stupid but possible), then all the members are compared by name, otherwise it falls back to comparing by index.

Examples

dv> a      
345x200x10 array of float, bsq format [2,760,000 bytes]

dv> b
345x200x10 array of float, bsq format [2,760,000 bytes]

dv> c
"bob"

dv> equals(a,b)
1

dv> equals(a,c)
0

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

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

All other topics

  • See navigation on the left


Recent Core Changes

Modified On: 11-17-2016

Personal tools