Alpha DevCon 2018
Results 1 to 2 of 2

Thread: Desktop Closing Alpha For Backup

  1. #1
    Member
    Real Name
    Craig Schumacker
    Join Date
    May 2000
    Posts
    684

    Default Desktop Closing Alpha For Backup

    If you are backing up your Alpha desktop app, this may help you automatically get the users out during the time frame the backup is running.

    This is a sample of one possible way to notify a user you will be closing your app in x minutes, and what time they will be able to get in again after the backup.

    It is very basic using tidbits of code in two form OnTimer events, and the Autoexec script. There is also a couple lines of code on an OK button.

    What it does:

    1) On opening the app, a form is loaded (hidden) with an OnTimer running every 15 seconds.

    2) If the time falls between 09:00 PM and 09:05 PM, a form (ACKNOWLEDGMENT) will open and alert the user that the app will close at 09:05 PM for a backup.

    3) If the user clicks the OK button, the message is subdued for the balance of the 5 minutes. If he does not click ok, he's probably not at his desk, and the process continues.

    4) At 09:05, the app will close abruptly. (You can give a one minute warning, if you add another form popping up at that time, if you so choose.)

    5) If the user tries to open the app between 09:05 PM and 09:15 PM, they are briefly alerted that a backup is underway, and Alpha closes.

    You need to adjust the times in the autoexec script, and on the OnTimer events to your own times.

    To cut down on milliseconds of overhead, the SHUTDOWN form on timer event has a section that checks to see if it is before 09:00 PM, and if so, the script stops there.

    If desired, you can add a little code to detect which computers or users this applies to.


    The above will allow backing up files that may otherwise have been in use, but if the user goes in while the backup is running, he may prevent the backup of the shutdown table (not needed, anyway) and the ADB files may not get backed up. This, too, is not an issue unless you are developing the app at that site.

    You will need to change your system time to test this, which might mean you need to turn off your clock synchronizing with a time server. Also, Alpha's Internal Licensing doesn't take well to incorrect dates, ao try to test on today's date, only.

    Hint:

    The best backup will run from the machine that is your data server. Newer Windows versions, in most cases, use a shadow copy to create a backup of a locked file.
    Attached Files Attached Files
    Last edited by CraigSchumacker; 10-09-2015 at 02:36 PM.

  2. #2
    Member
    Real Name
    Craig Schumacker
    Join Date
    May 2000
    Posts
    684

    Default Re: Desktop Closing Alpha For Backup

    If you find users are leaving forms open with unsaved changes, and the app is not closing because it wants you to "save Or Lose Changes", you can add a line to force all forms to close (un-saved changes will be lost).

    Open the SHUTDOWN form in design mode, go to the OnTimer event for that form, and add:

    a5_close_all_windows(.t.)

    just prior to:

    a5.close()

Similar Threads

  1. NEW Alpha Five v11 Desktop Edition for developing desktop apps
    By Richard Rabins in forum Alpha Five Version 11 - Desktop Applications
    Replies: 33
    Last Post: 02-07-2012, 07:06 AM
  2. New! Alpha Five v11 Desktop Edition for developing desktop apps
    By Richard Rabins in forum Alpha Five Version 10 - Desktop Applications
    Replies: 12
    Last Post: 02-05-2012, 11:25 AM
  3. New! Alpha Five v11 Desktop Edition for developing desktop apps
    By Richard Rabins in forum Alpha Five Version 9 - Desktop Applications
    Replies: 13
    Last Post: 02-05-2012, 09:38 AM
  4. Ask before closing Alpha 5 v6
    By Paul Main in forum Alpha Five Version 6
    Replies: 4
    Last Post: 11-13-2005, 09:28 AM
  5. Closing Alpha
    By Ted Giles in forum Alpha Five Version 4
    Replies: 2
    Last Post: 08-21-2000, 05:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •