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

Home » Public Forums » archive » Theoretical Programmers Wanted
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Theoretical Programmers Wanted [message #36589] Tue, 07 October 2003 17:55 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Hi Folks,

Here is one for all you theoretical programmers out there.

I have a simple test program. Call it TEST1. Here it is.

PRO Test1_Event, event
Widget_Control, event.top, Get_UValue=label
FOR j=0,49 DO BEGIN
Widget_Control, label, Set_Value=String(j,format='(I3.3)')
Wait, 0.1
ENDFOR
Widget_Control, event.top, /Destroy
END

PRO Test1
tlb = Widget_Base(Column=1, XOffset=200, YOffset=100)
label = Widget_Label(tlb, Value='000', XSize=100, /Align_Center)
button = Widget_Button(tlb, Value='Start Program')
Widget_Control, tlb, /Realize, Set_UValue=label
XManager, 'test1', tlb, /No_Block
END

When you run it, a graphical user interface appears, you click
the "Start Program" button and the label counts up to 49. Perfect!
Now you make a save file out of it:

IDL> .compile test1
IDL> Resolve_All
IDL> Save, File='test1.sav', /Routines

Quit IDL and double click the save file. Still runs like a champ!

Now, here is another file, very similar to the first.

PRO Test2
tlb = Widget_Base(Column=1, XOffset=200, YOffset=100)
label = Widget_Label(tlb, Value='000', XSize=100, /Align_Center)
Widget_Control, tlb, /Realize, Set_UValue=label
XManager, 'test2', tlb, /No_Block
FOR j=0,49 DO BEGIN
Widget_Control, label, Set_Value=String(j,format='(I3.3)')
Wait, 0.1
ENDFOR
Widget_Control, tlb, /Destroy
END

When you run it, a graphical user interface appears and the
label counts up to 49. Perfect! But now you make a save file
out of this:

IDL> .compile test2
IDL> Resolve_All
IDL> Save, File='test2.sav', /Routines

When you quit IDL and double click the save file, you get
the label appearing in the top-level base, but no count up
on the label. It stays stuck at 000. :-(

Here's my theoretical question: Why?

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: chi^2 minimisations & calling c
Next Topic: Complex numbers

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

Current Time: Wed Oct 08 17:18:03 PDT 2025

Total time taken to generate the page: 0.00383 seconds