SAME Function
Standard Library function that tests if two variables are the same.
Usage
result = SAME(x, y)
Input Parameters
xA variable.
yA variable.
Returned Value
result—1 if two variables are the same (within keyword settings), 0 if not.
 
note
For Named Structures, the name is not tested, so {a,x:1} is same as {b,x:1}.
Keywords
NoType—If set, types of x and y are ignored. (FINDGEN(5) is same as INDGEN(5).)
NoDim—If set, the dimensions of the arrays are ignored. ([1,2,3,4] is the same as [[1,2],[3,4]] - same as SAME(a(*),b(*).)
NoVal—If set, values in arrays are ignored. ([1,2,3] is the same as [3,4,5].)
Tl—A tolerance on the comparison of numerical values.
Verbose—Setting this keyword will print a message to the PV‑WAVE window indicating what is different between the variables. If they are the same, no message is printed.
Examples
a = INDGEN(5)
b = DINDGEN(5)
; To test for exact match:
result = SAME(a, b)
PRINT, result
; To test for compatible sizes (replaces multiple SIZE calls):
result = SAME(a, b, /NoType, /NoVal)
PRINT, result
See Also