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

Home » Public Forums » archive » MESSAGE (used in VM) invokes DIALOG_MESSAGE: Can this be suppressed?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: MESSAGE (used in VM) invokes DIALOG_MESSAGE: Can this be suppressed? [message #88396 is a reply to message #88391] Mon, 21 April 2014 15:25 Go to previous messageGo to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Monday, April 21, 2014 1:05:57 PM UTC-6, Edward Hyer wrote:
> On Thursday, April 17, 2014 3:57:37 PM UTC-7, Edward Hyer wrote:
>
>> On Thursday, April 17, 2014 1:23:24 PM UTC-7, Chris Torrence wrote:
>
>>
>
>>> Which platform is this on? And how are you running it non-interactively?
>
>>
>
>>
>
>>
>
>> Linux. The DIALOG_MESSAGE behavior happens with either -rt or -vm.
>
>
>
> If you're wondering why this matters: when the dialog with the message pops up, indicating a terminal error, the job does not end. The IDL job continues, including holding onto the license when run with -rt, until the "OK" button in the error dialog is manually clicked.

Okay, I've tracked this down to "idlrtmain.sav", which controls "rt" and "vm" mode. Inside it has the following code block:

CATCH, Err
if(Err ne 0)then begin
catch, /cancel
error_msg = !error_state.msg

; on unix we may not have a display (an error condition
; in vm mode, not runtime mode) try to prevent an additional
; error about dialog_message when reporting the initial error.
; just check to see if the display is unset (an incomplete test)
; rather than using a DEVICE call (which would need another
; catch block).
if (!VERSION.OS_FAMILY eq 'unix' && $
strlen(getenv('DISPLAY')) eq 0) then begin
MESSAGE, error_msg
endif else begin
result = DIALOG_MESSAGE(error_msg)
endelse
return
endif

So, as you discovered, if your DISPLAY is not set then you are fine - the output will get directed to the terminal.

As a workaround, you can simply disable the DISPLAY environment variable from within IDL, and then re-enable it. Something like:

mydisp = GETENV('DISPLAY')
SETENV, 'DISPLAY='
MESSAGE, 'bad error'
SETENV, 'DISPLAY=' + mydisp

You could even put this into a catch block so all of your errors would funnel through it.

In the meantime, I'll take a look at modifying this code (or ripping it out) for IDL 8.3.1.

Cheers,
Chris
ExelisVIS
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: traces plot outside of x-axis boundaries
Next Topic: Reading a Python numpy save (.npy) file into IDL

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

Current Time: Fri Oct 10 10:15:50 PDT 2025

Total time taken to generate the page: 0.80039 seconds