Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2005
    Location
    Birmingham, Alabama
    Posts
    175

    Overide Global Function?

    ok, this is a great function to prevent people from closing the app, but what do I do when I need to close the app without the users input i.e. not showing the dialog confirmation?

    Code:
    --This code asks user to "BE sure that they want to exit"
    function QueryAllowProjectClose()  --this function will be called when the program is exiting
        if close_value
        then Application.Exit(0);
        else
        confirmation = Dialog.Message("NOTICE", "WARNING! \r\ If you close this license manager you will not be able to run Credit Mechanic software.\r\Are you sure you want to Exit?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
        if confirmation == 6 then
       -- The yes button was pressed, allow program to close (return true)
           return true;
       
       else
           -- The yes button was NOT pressed, do NOT allow the program to close (Return false)
            return false;
        end
    end
    end
    I just keep running into problems this weekend!
    thanks in advance.

  2. #2
    Join Date
    Aug 2003
    Posts
    2,427
    You don't need to do anything at all really, at an appropriate point in your code use -

    Application.Exit();

    That doesn't call for any user interevention.

  3. #3
    Join Date
    Feb 2005
    Location
    Birmingham, Alabama
    Posts
    175
    Well, the code is in the "Global Function" area. So whenever the application closes, it displays the dialog.

    Yes, i have tried the Application.Exit();

    take a look a the sample project
    Attached Files

  4. #4
    Join Date
    Aug 2003
    Posts
    2,427
    One approach would be to control whether the global function is 'activated' by using a variable as in my update to your example.

  5. #5
    Join Date
    Feb 2005
    Location
    Birmingham, Alabama
    Posts
    175
    Worked like a charm! thanks!

    I'll get the hang of this stuff one day!

Similar Threads

  1. buttons disappear
    By mgokkaya in forum AutoPlay Media Studio 6.0
    Replies: 5
    Last Post: 04-11-2008, 02:40 PM
  2. Another tough one... Interaction between Web and AMS
    By Agent Jones in forum AutoPlay Media Studio 5.0
    Replies: 13
    Last Post: 08-18-2005, 02:10 PM
  3. Global Function vs On Startup
    By Sergio_S in forum Setup Factory 7.0
    Replies: 3
    Last Post: 05-29-2005, 10:02 AM
  4. Global Function "Loads of fun"
    By Bruce in forum AutoPlay Media Studio 5.0
    Replies: 15
    Last Post: 01-23-2004, 04:22 PM
  5. Global list function disapeared ?
    By cgirolet in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 12-05-2003, 12:52 PM

Posting Permissions

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