|
Re: complex number woes (help please) [message #47666 is a reply to message #47665] |
Sun, 26 February 2006 19:29  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Steve writes:
> 'm working on a GUI that has 2 text widgets that I use to get the real
> and imaginary parts of a complex number. I then wish to mutliply this
> number by every element in a 7x7 array, but my output is yielding only
> a single complex number (and not the 7x7 complex array output that I'd
> expect). Funny thing is, I can't seem to reproduce the problem if I
> just generate a complex number (that is not from my widget),
>
> Here's what I do to create the issue...
> ------------------------------------------------------------
>
> Any idea what's going on, and why there's a difference?
I didn't follow most of this, but I do know that you are
treating the value you get out of the text widgets as a scalar,
and it never is. It is *ALWAYS* a 1-element array. This could
be the cause of all your problems. :-)
Try something like this and let us know if it is still
a problem:
Widget_Control, textID, Get_Value=textValue
textValue = Float(textValue[0])
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|