Fw: Why Are Changes Saved
Brian K. White
brian at aljex.com
Thu Nov 20 12:07:09 PST 2008
I am assuming (presuming?) this direct reply was a mistake and bouncing
it back to the list, and replying to it at the same time.
>> In this case those X and S options are generated by your program, not by filepro. They do whatever you or your programmer wrote them to do.
>>
>> Which means you have two choices:
>> 1) To make the X key act as you wish, contact whoever wrote your program, or get some other filepro programmer to look into modifying your program, or do it yourself.
>>
>> or 2) use ctrl-c (before ever hitting esc, since esc saves)
>>
>
> Hi Brian,
>
> Sorry I wasn't clear. When one wants to leave the program without
> saving any changes, he hits "X". The code is (if xy="X") (then exit
> "0"). To my knowledge, exit used to not save any changes.
>
> Harold
Ah ha.
Is this in an @keyX or in a @wlf or an input or waitkey prompt?
listbox? menu command?
If it's an @key, then it's too late to discard changes. They had
to have been either saved or discarded already to go from update
mode to view mode where @keys apply.
For all the others, I am not sure about exits exact behaviour in
this respect because we just never do that.
We tell people to use ctrl-c to abort things, so generally we
expect all updates that aren't ctrl-c aborted, to actually be
applied.
I don't see any mention in the documentation for the exit command
that says either way, that it applies all pending writes or aborts
them. And since it doesn't say, then I at least would expect that
it does a full graceful clean-up on it's way out. That would include
flushing all pending writes and closing all file handles.
Pending a more definitive answer on what exit is supposed to do,
some other ideas:
In cases where we do want changes to be collected and then
potentially discarded, but controlled by programming instead of
ctrl-c, then we don't actually modify the real fields in the
record we are standing on, we work with a free record which we
can later choose to either copy or delete. Or collect a copy of
the record into an array at the start, and then at the end to
abort changes copy the array holding the starting values back
over the record.
Editing the current record and relying on something like exit
acting as ctrl-c seems chancy at best to me.
Too many commands will or can automatically flush pending writes
along the way even if exit doesn't
You could also try pushkey "[BRKY]"
I think pushkey is a kludgy way to do things, but, shrug, it is
there and should work as long as the writes haven't already been
applied by something else like a close or write statement.
--
Brian K. White brian at aljex.com http://www.myspace.com/KEYofR
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO FreeBSD #callahans Satriani Filk!
More information about the Filepro-list
mailing list