I’m another who often used paired
revert statements in my Pan6 procedures.
revert was listed as implemented in PanX a couple months back, but it’s not working reliably in my converted code. I offer a simple reproducible example of
revert not working properly although I’m not certain my converted code’s problem is identical.
Make a new empty database. Set the value of the one record for field A to “start”.
Enter the following procedure, save the db then run the procedure from the action menu:
Save A="changed" revert alertsheet "reverted"
The value of A is now “changed.” It doesn’t revert to “start” and the alertsheet doesn’t run. Choosing
Revert To Last Saved Version from the File menu doesn’t turn A back to “start” But
Revert to Browse All Versions does offer a version with “start.”
After fiddling with it a bit (mainly manually editing, undoing and redoing the value a few times) and rerunning the procedure a few times the alertsheet eventually ran, although I’m not sure what actually got the code working.
I could, in part, work around this problem by using
Saveacopyas instead of
importdatabase theCopy,"Existingdata","Replace" instead of
revert. I looked at
StartDatabaseChange for an alternative. It works well for manually undoing procedures, but I don’t see any interface for using its
undo within procedures. undo isn’t listed as a statement in Help and gives a syntax error when typed into a procedure window.