Re: How 2 read a matrix to a widget? [message #69613] |
Thu, 04 February 2010 06:49 |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Feb 4, 6:05 am, David Fanning <n...@dfanning.com> wrote:
> Dave_Poreh writes:
>> I want to read a matrix to a widget. For single number reading usually
>> I use:
>> READ, X, PROMPT = ' '
>> Now I want to read a row (or a matrix) to the widget .
>> Could anyone give me an idea?
>
> Humm. That doesn't seem very widgety to me. :-(
>
> How about creating a text widget, allowing the user
> to type as many numbers as they want there, then
> taking that line of code, as a string, and using
> STRSPLIT to convert the values to numbers:
>
> numbers = Float(StrSplit(textline, /Extract))
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Wow, Thanks David
It is great idea. Works perfectly.
Cheers
|
|
|
Re: How 2 read a matrix to a widget? [message #69614 is a reply to message #69613] |
Thu, 04 February 2010 06:05  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Dave_Poreh writes:
> I want to read a matrix to a widget. For single number reading usually
> I use:
> READ, X, PROMPT = ' '
> Now I want to read a row (or a matrix) to the widget .
> Could anyone give me an idea?
Humm. That doesn't seem very widgety to me. :-(
How about creating a text widget, allowing the user
to type as many numbers as they want there, then
taking that line of code, as a string, and using
STRSPLIT to convert the values to numbers:
numbers = Float(StrSplit(textline, /Extract))
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|