CantDelete won't work. Why?

Here's where to discuss using Stéphane Leys' very well done alternative runtime editor. If you're a control freak at runtime you have to check this out!

CantDelete won't work. Why?

Postby drpitcairn » Mon Jun 01, 2009 4:02 pm

My script has a card copied, then another project is opened and the card pasted to that one. Then I have this line:
Code: Select all
set the cantDelete of cd "Analysis" to false


But nothing happens, that is, the cantDelete request does nothing. The same lack of result if I use the message box to send the request or if I put it like this:
Code: Select all
set the cantDelete of this cd to false


The bg is not set to cantDelete so that is not the obstacle.
I have been struggling with it over an hour. Any suggestions?

Thanks,
Richard
User avatar
drpitcairn
 
Posts: 1023
Joined: Thu Apr 02, 2009 9:39 am
Location: Sedona, Arizona

Re: CantDelete won't work. Why?

Postby drpitcairn » Mon Jun 01, 2009 4:56 pm

I think I might have it figured out. The script appears to be correct but the PI module does not reflect the change. If I use the msg box to make the change and then check the change just now by putting in:
Code: Select all
the cantdelete of cd "Analysis" is false

and it comes back as "true".
So must be that the change was made but the PI module does not reflect it.
User avatar
drpitcairn
 
Posts: 1023
Joined: Thu Apr 02, 2009 9:39 am
Location: Sedona, Arizona

Re: CantDelete won't work. Why?

Postby Scott » Mon Jun 01, 2009 5:50 pm

I think your getting stuck on a double negative here.

If I am safely assuming you want the card to not be able to be deleted, why would you set the cantDelete to false? You would want the cantDelete to be true, right?

Putting the cantdelete of cd "Analysis" is false into the message box would evaluate the expression as to whether the property is set to false, and if it is, will return true. Putting the cantdelete of cd "Analysis" into the message box will actually return the value of the property.
User avatar
Scott
Site Admin
 
Posts: 1217
Joined: Sat Jul 05, 2008 1:37 pm
Location: Northern Sierra Nevada

Re: CantDelete won't work. Why?

Postby drpitcairn » Mon Jun 01, 2009 6:02 pm

I am transferring a card to another project where cards are being stored. The source project has the card set to "cantdelete is true" meaning it can't be deleted. On transferring it to the storage project I want to change that so the user can delete that copy when it is no longer needed. Thus my script changes it from "true" to "false". However on trying to do that I am not having luck. Part of the confusion is that the MPI module I am using does not update so the only way I can check to see if the change was made was to put a query into the msg box. What puzzles me is that my script is transferring the card over, deleting a number of buttons and bg fields successfully yet not changing the "cantdelete" status as expected. I can't figure out why.

Thanks,
Richard
User avatar
drpitcairn
 
Posts: 1023
Joined: Thu Apr 02, 2009 9:39 am
Location: Sedona, Arizona

Re: CantDelete won't work. Why?

Postby Scott » Mon Jun 01, 2009 6:24 pm

I see. So you have a card whose cantDelete property is set to true, as it was copied from another window/project, and are trying to set it to false.

What happens when you open the message box and type:

set the cantDelete of this cd to false

and hitting <enter>

and then entering:

the cantDelete of this cd

and hitting <enter>

Does it return false?
User avatar
Scott
Site Admin
 
Posts: 1217
Joined: Sat Jul 05, 2008 1:37 pm
Location: Northern Sierra Nevada

Re: CantDelete won't work. Why?

Postby drpitcairn » Mon Jun 01, 2009 7:01 pm

What happens when you open the message box and type:

set the cantDelete of this cd to false
and hitting <enter>

No observable change in the MPI PI module. Shows that the "cantdelete" box is still checked. (Sorry that I put this in the wrong part of the forum. When I started the question I did not realize that MPI was involved with this.)

and then entering:
the cantDelete of this cd
and hitting <enter>
Does it return false?

It does return false.

I am thinking it is just an issue with MPI. I was expecting it to show the change and it is not. I tried moving from that card to another and coming back but MPI does not refresh and show the change. I think we will have to wait for Stephane to respond.
User avatar
drpitcairn
 
Posts: 1023
Joined: Thu Apr 02, 2009 9:39 am
Location: Sedona, Arizona

Re: CantDelete won't work. Why?

Postby S. Leys » Mon Jun 01, 2009 10:57 pm

rpitcairn wrote:
I am thinking it is just an issue with MPI. I was expecting it to show the change and it is not. I tried moving from that card to another and coming back but MPI does not refresh and show the change. I think we will have to wait for Stephane to respond.


Yes, it's a bug. Thanks for reporting it.
I'll try to post a fix ASAP.

S.
User avatar
S. Leys
 
Posts: 628
Joined: Sun Jul 06, 2008 11:03 am


Return to Using MPI

Who is online

Users browsing this forum: No registered users and 1 guest

cron