Add two new properties to your base form class: cSetConfirm and cSavedSetConfirm (this one with =set('confirm') in property sheet).
In your form's Load event add
if this.cSetConfirm = 'ON'
set confirm ON
else
set confirm OFF
endif
In Destroy restore current (saved) setting.
So, in your forms where you don't want default OFF behavior you would set this property to ON in property sheet.
>>>>Keep in mind that SET CONFIRM is scoped to the current data session.
>>>
>>>I noticed that, when I read the rules for SET CONFIRM. I didn't feel like adding it to the data environment of each form, so I issued the command before any of my forms opened and it was inherited throughout. I will only need to add a SET CONFIRM OFF (if desired) to the data environment of specific forms where I don't want it ON.
>>
>>If you're not using Private Datasessions than everything runs in the Default Datasession and settings will be shared by all forms. It also means that changing a settings in a form, w/o restoring it when forms closes, will change it for all other forms as well.
>
>It did seem unexpected to me that the SET COMFIRM setting got inherited, as I always use Private Data Sessions, so I guess I ignored the way it was working as I liked the result in this case. Your comment made me look closer, and I found that, somehow, the particular form that I was working with had been changed accidentaly to use a default datasession. (I've changed it back to Private now)
>
>I can modify my custom form class to set CONFIRM ON, but as I have a number of customers that might like the OFF setting, I guess I'll hand code the CONFIRM ON setting into the current project's Form Inits. Is there an easier way?
If it's not broken, fix it until it is.
My Blog