Re: Error in Object [message #46049] |
Thu, 03 November 2005 18:32 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
shi_lee@hotmail.com writes:
> thank you Dr.Fanning, could you explain in a little more detail. I am
> pretty unfamiliar with this area. Should I switch oview with state when
> passing the parameters? I tried, but still does not work. Thanks.
Well, obviously, I can't tell exactly what you are doing
wrong without examining the code (and I don't examine code,
as a rule, unless someone is forking over some money), but
from the kind of errors you were getting it is clear that
you don't have what you think you have. I thought there
was a reasonably good chance you had confused one variable
with another.
I think you should learn how to set breakpoints in your
code so that you can stop and examine variables yourself.
This is a standard programming practice and everyone should
know how to do it. I've been teaching a beginning programming
class this week, and you have to hammer on some of these people
to even look at the error message so they know what line in
their program caused the error! (And I swear some of the antique
text editors they use don't even have a way to go to the line
that caused the error! Sheesh! It's like trying to hit a tennis
ball blindfolded.)
But, that is neither here nor there. Just poke around in
there until you understand what is going on. I did get a
sense that maybe you were a little inexperienced in this
business. Object graphics code is probably not the best
place to start learning, under the circumstances. Is there
a particular reason you have started there?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Error in Object [message #46054 is a reply to message #46049] |
Thu, 03 November 2005 15:49  |
IDLmastertobe
Messages: 54 Registered: June 2004
|
Member |
|
|
thank you Dr.Fanning, could you explain in a little more detail. I am
pretty unfamiliar with this area. Should I switch oview with state when
passing the parameters? I tried, but still does not work. Thanks.
|
|
|
Re: Error in Object [message #46057 is a reply to message #46054] |
Thu, 03 November 2005 09:05  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
shi_lee@hotmail.com writes:
> Hi, i am trying to set property of a IDLgrView, but i received an error.
> The code is as follows:
>
> pro demo_draw, state, oWindow, oView, debug=debug
> ....
> oView property is something i want to change. and I received an error:
> "Object reference type required in this context: OVIEW.". If instead of
> having [100,100,100] as the color, i use [state.BR, state.BB, state.BG],
> which are data saved in state structure, i receive another error:
> "Object instance data is not visible outside class methods: STATE". Does
> anyone know why? Thank you.
My guess is that you have mixed up the order in which
you passed the positional parameters to DEMO_DRAW. I think
your "state" is really the "oView", and visa versa.
Cheers,
David
P.S. Are you sure you are ready for object graphics? Lots
of complicated programming is going to have to be done there. :-)
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|