Modify ↓
Opened 15 years ago
Closed 15 years ago
#1142 closed Bug (No Bug)
_ArraySearch return 0 (number vs string)
Reported by: | JKFN | Owned by: | Gary |
---|---|---|---|
Milestone: | Component: | Standard UDFs | |
Version: | 3.3.1.1 | Severity: | None |
Keywords: | _ArraySearch | Cc: |
Attachments (0)
Change History (2)
comment:1 Changed 15 years ago by jchd
comment:2 Changed 15 years ago by Valik
- Resolution set to No Bug
- Status changed from new to closed
The equality test is essentially:
0 = Number("string")
The statement Number("string") returns 0 which compares true against 0 which means the search was successful and the index was found.
This is not a bug.
Guidelines for posting comments:
- You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
- In-depth discussions should take place on the forum.
For more information see the full version of the ticket guidelines here.
Note: See
TracTickets for help on using
tickets.
I may be mis-interpreting something here but it is my understanding that:
[from Helpfile, Datatypes]
So I'm not completely surprised that the comparison made (0 = "string") is interpreted as (0 = Number("string")) which is (0 = 0) and thus succeeds at index 0 of the array given in exemple.
Disclaimer: of course it can be objected that comparing oranges with keyboards is by itself a bad idea. OTOH the variant nature merely invites such operations.