Home »
Public Forums »
archive »
Array subscripting oddity
Array subscripting oddity [message #1278] |
Tue, 17 August 1993 06:55 |
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
------------------------------------------------------------ ------------
|
|
|
Current Time: Thu Oct 09 21:18:48 PDT 2025
Total time taken to generate the page: 0.08306 seconds