X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 01 Nov 2013 02:11 PM by  anon
Negative array index
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
01 Nov 2013 02:11 PM
    I wanted to turn off negative index using the commands "COMPILE_OPT STRICTARRSUBS" . Assume x = indgen(100). New IDL 8 returns error for x[[-1,-2]], but not for x[-1]. Is there anyway that I can turn off the negative indexing completely? Thank you in advance!

    Deleted User



    New Member


    Posts:81
    New Member


    --
    09 Nov 2013 12:30 AM
    Hi, I'm afraid that negative index subscripting in IDL can't be disabled. Also, you may already be aware but the STRICTARRSUBS setting to COMPILE_OPT only applies to array subscripting but not scalar index subscripting. This is mentioned in the IDL Help under the Contents section: Language > Arrays > Using Arrays as Array Subscripts or on the Exelis VIS web site Documentation Center: http://www.exelisvis.com/docs/Using_A... under the sub-sections: Array Subscripts and Clipping Negative Indices versus Array Subscripts I'm sorry I don't have better news. Regards, Jim Exelis VIS
    You are not authorized to post a reply.