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

Home » Public Forums » archive » How can I show error line numbers when running .sav on Virtual Machine
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
How can I show error line numbers when running .sav on Virtual Machine [message #86253] Mon, 21 October 2013 19:51 Go to next message
timothyja123 is currently offline  timothyja123
Messages: 57
Registered: February 2013
Member
Hi guys,

My application has the following code to catch as display errors:

CATCH, errorNum
IF (errorNum NE 0) THEN BEGIN
CATCH, /Cancel
HELP, /Last_Message, Output = lastError
v = DIALOG_MESSAGE(LastError)
Error = LastError[0]
RETURN
ENDIF


The application is built into a .sav file and run on the IDL Virtual Machine. My problem is that when an error is hit there are no line numbers in the error message. Is there some way to build the .sav file to retain and display the line numbers like when running directly from the source in the Workbench?

Tim

IDL version 8.2.3
Re: How can I show error line numbers when running .sav on Virtual Machine [message #86254 is a reply to message #86253] Mon, 21 October 2013 20:22 Go to previous messageGo to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
<timothyja123@gmail.com> wrote:
> Hi guys,
>
> My application has the following code to catch as display errors:
>
> CATCH, errorNum
> IF (errorNum NE 0) THEN BEGIN
> CATCH, /Cancel
> HELP, /Last_Message, Output = lastError
> v = DIALOG_MESSAGE(LastError)
> Error = LastError[0]
> RETURN
> ENDIF
>
>
> The application is built into a .sav file and run on the IDL Virtual
> Machine. My problem is that when an error is hit there are no line
> numbers in the error message. Is there some way to build the .sav file to
> retain and display the line numbers like when running directly from the
> source in the Workbench?
>
> Tim
>
> IDL version 8.2.3

I'm not near a computer, but how about the TRACEBACK keyword to HELP?

Mike
--
www.michaelgalloy.com
Research Mathematician
Tech-X Corporation
Re: How can I show error line numbers when running .sav on Virtual Machine [message #86255 is a reply to message #86253] Mon, 21 October 2013 20:36 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
timothyja123@gmail.com writes:

> The application is built into a .sav file and run on the IDL Virtual Machine. My problem is that when an error is hit there are no line numbers in the error message. Is there some way to build the .sav file to retain and display the line numbers like when running directly from the source in the Workbench?

There are no line numbers in a save file, it is a binary file. If you
are running directly from source, there is no save file. So... Not sure
what you are asking for here.

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: How can I show error line numbers when running .sav on Virtual Machine [message #86256 is a reply to message #86255] Mon, 21 October 2013 21:56 Go to previous messageGo to next message
timothyja123 is currently offline  timothyja123
Messages: 57
Registered: February 2013
Member
> There are no line numbers in a save file, it is a binary file. If you
>
> are running directly from source, there is no save file. So... Not sure
>
> what you are asking for here.

Huh? I though I was pretty clear with my question. "Is there some way to build the .sav file to retain and display the line numbers"

Most languages allow you to compile code into binary form and retain extra debug information. Especially those run on a VM as the code is not actually converted to a machine code its just bytecode (I'm assuming this is how IDL works also).
For example Java always retains line numbers.
Re: How can I show error line numbers when running .sav on Virtual Machine [message #86257 is a reply to message #86255] Mon, 21 October 2013 22:11 Go to previous messageGo to next message
timothyja123 is currently offline  timothyja123
Messages: 57
Registered: February 2013
Member
> There are no line numbers in a save file, it is a binary file. If you
>
> are running directly from source, there is no save file. So... Not sure
>
> what you are asking for here.

After re-reading your post I think I understand what you are trying to say. Yes a sav file obviously has no line numbers. My question was about retaining the line numbers from the original source code definition used to create the .sav file. As per the explaination on my previous reply.
Re: How can I show error line numbers when running .sav on Virtual Machine [message #86258 is a reply to message #86254] Mon, 21 October 2013 22:20 Go to previous message
Moritz Fischer is currently offline  Moritz Fischer
Messages: 32
Registered: June 2013
Member
Indeed, you can get the line number with the statement
(SCOPE_TRACEBACK( /STRUCT )).line[-1]
The problem is, in your case, where to put it (in the catch block
doesn't make sense). Maybe you could write a wrapper routine for error
handling, and thus preserve the line number?

Am 22.10.2013 05:22, schrieb Michael Galloy:
> <timothyja123@gmail.com> wrote:
>> Hi guys,
>>
>> My application has the following code to catch as display errors:
>>
>> CATCH, errorNum
>> IF (errorNum NE 0) THEN BEGIN
>> CATCH, /Cancel
>> HELP, /Last_Message, Output = lastError
>> v = DIALOG_MESSAGE(LastError)
>> Error = LastError[0]
>> RETURN
>> ENDIF
>>
>>
>> The application is built into a .sav file and run on the IDL Virtual
>> Machine. My problem is that when an error is hit there are no line
>> numbers in the error message. Is there some way to build the .sav file to
>> retain and display the line numbers like when running directly from the
>> source in the Workbench?
>>
>> Tim
>>
>> IDL version 8.2.3
>
> I'm not near a computer, but how about the TRACEBACK keyword to HELP?
>
> Mike
>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: most probable value of a data set
Next Topic: Re: object argument passing behaviour changed in v8.2.2?

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

Current Time: Wed Oct 08 11:45:22 PDT 2025

Total time taken to generate the page: 0.00512 seconds