DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

PicDelete and PicLoad asking to save changes when called from SUD

Hello!

 

I'm trying to load different reports, change text values and graphics and export those reports to images. Sometimes I want to remove all reportsheets and load a new layout, but when calling picdelete a messagebox pops up and asks the user whether he wants to save the changes. I'm trying to get rid of that messagebox because my script gets halted and I don't want the user to overwrite my layout.

This only happens when picdelete is called from a SUD and for the picdelete command this behaviour can be circumvented by using Call Execute("Call picdelete"). Sadly the same procedure does not work for the picload command.

When called from the DIAdem scripting tab the report is loaded fine but I have found no way to use this command from a SUD without the messagebox appearing.

Is there a workaround? Does DIAdem 2012 show the same behaviour?

 

Edit: I guess I was wrong about that Call Execute("Call picdelete") workaround. I'm seeing the same messagebox. I don't know why I thought that helped.

 

Best regards,

grmume

 

PS: I'm using DIAdem 2011

0 Kudos
Message 1 of 4
(5,462 Views)

Hi grmume

 

In DIAdem 2012 the behavior is the same. But we have a completely new easy to use object oriented programming interface. There exist a method that reset the modified status of the Report

http://zone.ni.com/reference/en-XX/help/370858K-01/reportapi/methods/report_method_resetmodified_ire...

In former versions you only have the readonly variable PicIsChanged.

But I tried a small script in DIAdem 2011 after changing the layout and it does not ask for saving the layout.

call PicDelete
Call picload("Demo.TDR")

 Hope this helps

 

Winfried

 

0 Kudos
Message 2 of 4
(5,444 Views)

Hi grmume,

 

I don't think the behaviour is strange:

 

DIAdem ask you everytime when closing a window after changing something for saving these changes. This is to avoid loosing data/changes.

 

I would like to know why you have a layout and doing changes everytime. Is it realy necessary?

It would be a possible way to check for changes, saving the layout, deleting this file and going on after these steps

 

Kind regards,

 

Philipp K.

AE | NI Germany

0 Kudos
Message 3 of 4
(5,413 Views)

Hi grmume,

 

I recommend saving the current REPORT contents to a dummy TDR file before deleting the REPORT contents.  You can leave the path coded to the same file relative to the calling script and reuse it, like this:

 

Call PicSave(AutoActPath & "Last.TDR")

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 4 of 4
(5,395 Views)