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

Home » Public Forums » archive » Array subscripting oddity
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Array subscripting oddity [message #1278] Tue, 17 August 1993 06:55
glenn is currently offline  glenn
Messages: 5
Registered: May 1993
Junior Member
I thought I understand array subscripting in PV-wave but this bit of
code has got me foxed. I was trying to figure out what was going wrong
with a procedure and finally tracked it down to a problem that I can
demonstrate using the following example:

WAVE> a=indgen(3)
WAVE> print,a
0 1 2
WAVE> m=[45,99]
WAVE> print,m
45 99
WAVE> a(m)=255
WAVE> print,a
0 1 255

Now, I would have thought that because both elements of 'm' are more
than the size of 'a', no element of 'a' would have been assigned?
The values '45' and '99' are completely arbitrary. You can set them to
anything you like.

If someone could explain what's going on here (maybe it's a bug??) I'd
be most grateful. The configuration is PV-wave 4.01 running on SunOS
4.1.3.

Thanks.

---
------------------------------------------------------------ ------------
Dr Glenn Carver Email: glenn@atm.ch.cam.ac.uk
Centre for Atmospheric Science Phone: (44-223) 336521
Chemistry Department Fax : (44-223) 336362
Cambridge University
UK
------------------------------------------------------------ ------------
[Message index]
 
Read Message
Previous Topic: Re: Problems with filled contours?
Next Topic: Sorting

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

Current Time: Fri Oct 10 10:50:29 PDT 2025

Total time taken to generate the page: 1.11896 seconds