Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Exit from X

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Exit from X

    XP Pro
    Build 1545-2029

    In a5v5 I could run the following script on all my forms using the CanExit event and it works correctly.

    Also, on each form I have a button that exits the user back to a menu. Selecting these buttons would not activate the CanExit event but take the user to the desired menu form and close the previous open form.


    SCRIPT:
    response = ui_msg_box("","Are you sure you want to exit?, Have you completed the daily tasks?", UI_YES_NO)
    if response= UI_YES_SELECTED then
    a5.close()
    else
    cancel()

    end if

    Now in a5v6 using the X to exit it works, but, if I exit the form using a button to go to a menu screen the CanExit event is also activated and the msg_box displayed, how can I stop this action from happening?

    Any help much appreciated

    Regards

    Alan

    #2
    RE: Exit from X

    Can you supply the code or a brief snippit?

    kenn
    TYVM :) kenn

    Knowing what you can achieve will not become reality until you imagine and explore.

    Comment


      #3
      RE: Exit from X

      Evening Ken,

      The code was in my previous post under the heading SCRIPT.

      Place this code on the CanExit event of a form that also has a button on the form to exit to another form and close the current form.

      The script should only fire when you select the X in the top right hand corner and not when you select a button to exit the form and close the form.

      Regards

      Alan

      Comment


        #4
        RE: Exit from X

        Hi Alan,

        OK, if I get time to look for it...........

        kenn
        TYVM :) kenn

        Knowing what you can achieve will not become reality until you imagine and explore.

        Comment


          #5
          RE: Exit from X

          My guess is that the problem is in your statement: "The script should only fire when you select the X in the top right hand corner and not when you select a button to exit the form and close the form."

          I can see where that could be a matter of opinion. It wouldn't surprise me that someone else complained that the CanExit event wasn't firing whenever the form was closed. It certainly sounds logical to me that the CanExit event should run whenever the form is closed.

          Without doing a lot of research (always a dubious situation), I would suggest adding a [shared?] variable definition in the button action and checking for this variable in the CanExit event script. That way you could tell how the user was attempting to exit the form.

          Cal Locklin
          www.aimsdc.net

          Comment


            #6
            RE: Exit from X

            Thank you Cal,
            The mystery is that in a5v5 it works when exiting from X and when exiting from buttons form to form there is no problem. It is only in a5v6 this is happening. Shouldn't v5 andd v6 be the same for this action?

            Will dig deeper but I think it will end up being a zip file to Selwyn.

            Regards

            Alan

            Comment


              #7
              RE: Exit from X

              I could be wrong but I believe this falls under the category of one of those things that "works more correctly" in v6. Each version has done this - tightened up previous "loose ends."

              I agree that they can be annoying when you are used to working with them in a way that no longer works but in the long run it's probably for the best.

              Comment


                #8
                RE: Exit from X

                Kenn and Carl,

                I received the following response from Selwyn;


                if you view the xbasic for the action script on the button, you will see
                parentform.close(.f.)

                change
                parentform.close(.f.)
                to
                parentform.close(.t.)

                In xbasic I created a generic "exit form" script using the above in lieu of the standard Action Script for exiting a form. I use this script when using the Exit from X script I submitted in my first report on this thread. It works :)

                Alan

                Comment


                  #9
                  Re: Exit from X

                  Alan
                  I know your post on this subject is very old but I am wondering about the same subject.

                  I am using V8. I wanted to prevent the user from closing a form. Just one of the forms, not all of them. So, I assigned the code cancel() to the canexit event for that form. It worked, the user can't close the form. Problem is, I can't close down Alpha5 either. I can't close anything unless I do a CTL ALT DEL and abort the application.

                  Any hints?
                  Jim Belanger

                  Comment


                    #10
                    Re: Exit from X

                    Post #18 in this thread from the A5v8 forum might help.

                    http://msgboard.alphasoftware.com/al...light=a5.close

                    Comment


                      #11
                      Re: Exit from X

                      Thanks Tom. I tried that and, at first, it didn't work. Then, I realized I needed to add the code a5.close() after the parentform.code.canexit="".
                      It worked well after that. I was afraid it would prevent other forms from closing but it didn't. So, that works well. Now, if the powers-at-be will accept this; I'll use it.
                      Jim Belanger

                      Comment


                        #12
                        Re: Exit from X

                        My joy was shortlived. Now, I can't edit that form. If I open the menu form in edit mode, the program opens a duplicate form. If I remove the canexit code and save it, the original form remains open and the code in effect. I even went to interactive and entered parent.form.code.canexit="" and that didn't clear it. So, how do I now place the menu form in the edit mode? Put yet another button on it?
                        Jim Belanger

                        Comment


                          #13
                          Re: Exit from X

                          Jim, I'm sorry. Don't have vers 6 installed. Was a bit worried that the vers 8 approach would be trouble free. Suggest you study all related threads in vers 5 and vers 6 forums for Alpha Five to see what others have done. Search key "a5.close" (include quote marks)

                          Comment


                            #14
                            Re: Exit from X

                            I am using version 8. What I did was put two buttons on the main menu. One does parentform.code.canexit=""
                            and the other does that as well as closes a5.
                            So, if I want to make edits, I use the one and if I want to close the form and the dbase, I use the other. seems to work OK.
                            Jim Belanger

                            Comment

                            Working...
                            X