More-Save Stack Woes - Could someone PLEASE explain this...
rjb at rz.uni-potsdam.de
Thu Apr 22 07:22:28 CDT 2004
>I know I could save the setting somewhere and restore them when
>Cancel is pressed, but isn't there another way?
>I have many hundreds of controls in a large number of dialog boxes
>and to save them all manually will be a lot of work.
>Could I save the whole (sub-)stacks/cards at a time and restore them
>when Cancel is pressed?
>Any tips on doing this would be greatly appreciated!
>It's not so much the leanring curve that's getting me down! It's the
>lack of any concrete answers to things that I know are possible.
>I've been led down so many blind all allies it's untrue!
>Thanks a lot
Your logic fails on the following: saving a stack, saves its state to
disk, so when you open it in another session, the 'new' version is
used. However, within a current run, whether you save it or not, the
current status is in memory. Closing the stack does not change
anything. Its last state remains in memory ready for subsequent use.
It follows that 'cancel' does not magically revert to the state
before user toggled some checkboxes (as it is in a case of C program
that call a dialog from DLOG resource). You either need to reset
things on 'cancel' or preserve new settings on 'save'. I see no way
around it. Take your peek which is better.
Now, you do not to save them ALL manually. This is what scripting is
for. You simply loop through your controls and save their state
More information about the use-livecode