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

Home » Public Forums » archive » pointers and IF statement
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
pointers and IF statement [message #46339] Wed, 16 November 2005 12:08
JJMeyers2 is currently offline  JJMeyers2
Messages: 12
Registered: October 2005
Junior Member
Hello,

I am trying to learn pointers and I had a problem while writing a
program.
My program is comparing two lists of data (list1,list2) and is trying
to find in which positions the data match, but because that might be in
more than 2 positions I am using the pointers to store the data. In the
case that the program does not find a match I want to be able to
substitute with another value.
So my program goes like this:

match1=ptarr(number,/allocate_heap)
FOR i=0,number-1 DO BEGIN
*match1[i]=WHERE(list1 GT list2(i))
IF *match1[i] EQ -1 THEN BEGIN
*match1[i]=WHERE(list1-list2(i) EQ min(list1-list2(i))
ENDIF
ENFOR

When i try to run this i get:
Expression must be a scalar or 1 element array in this context: <BYTE
Array[2]>.
and I can not figure out how to correct the problem.

Does anyone have any suggestions?

Thank you for the help!
[Message index]
 
Read Message
Previous Topic: limits of 'invert'
Next Topic: IDLgrPolygon -TEXTURE_MAP question

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

Current Time: Wed Oct 08 15:53:50 PDT 2025

Total time taken to generate the page: 0.00432 seconds