comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Another small V8.0 bug
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Another small V8.0 bug [message #71885 is a reply to message #71884] Mon, 26 July 2010 11:16 Go to previous messageGo to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Jul 26, 3:11 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Jul 26, 3:04 pm, wlandsman <wlands...@gmail.com> wrote:
>
>> OK, I've partially isolated the problem into a 3 line program.
>> Unfortunately, the first line is a call to a fairly long programhttp://idlastro.gsfc.nasa.gov/ftp/pro/database/dbopen .prosothere is
>> a lot more isolation required (and I am done with this for the
>> day).
>
>> pro test
>>  dbopen,'bpm16274'
>> list = [124]
>> if list(0) LE 125 then print,'Good value'
>
> The problem is that this line is comparing a list (an object, created
> on this line, which contains the single value 0) with 125. It is just
> the confusion between using the array called list, and the function
> list().
>
> Maybe I am missing something, but I do not see a bug, I see the old
> function/array problem, which manifested because IDL 8 happened to
> have a new builtin function with the same name as the array that was
> being used.

By the way, this case is fortunate because the operator used is le,
which is not overloaded in that class. The following line can be
misleading, as it would not throw an error:

IDL> print,list(0) eq 0
1

This is using the overloaded eq operator, to compare the list with 0.
Which may not be very noticeable if one is reading () as allowed index
operators. It would be more visible with the equivalent

IDL> print,list('abc') eq 'abc'
1
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: arbitrary precision in IDL?
Next Topic: Re: How to run a program for datasets located in different folders at a single stretch

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 14:34:17 PDT 2025

Total time taken to generate the page: 0.72028 seconds