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

Warning: .close(.F.) and CanExit event

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

    Warning: .close(.F.) and CanExit event

    Not long ago I discovered something that worked years ago had stopped working at some point. Namely, the .F. check flag on a parentform.close(.F.) button no longer triggers the CanExit event like it used to. This is true at least back to V10.5. My CanExit event was important, and that it stopped working went unnoticed by me and my client for a very long time.

    Yes, I submitted this as V12 bug but was told that instead of a fix they would just �deprecate� use the .F. check flag, meaning it was being marked as obsolete and warning against its use in the future so that it might eventually be phased out. This means either I have to not use a button with parentform.close(.F.) to close the form (the X still triggers CanExit) or I have to put my CanExit code above parentform.close() on my button. Not a big deal as long as one is aware of the situation, which I suppose is why it doesn't warrant fixing as a bug--if any desktop bugs warrant fixing in these web/mobile days. Also, the Wiki was updated with the deprecation notice, but unless they have recently changed it for new buyers of V12, the V12 Help file will still falsely say (.F.) will trigger the CanExit event.

    I'll probably put a link to this in forums for older A5 versions.

    Raymond Lyons

    form.close.jpg


    #2
    Re: Warning: .close(.F.) and CanExit event

    several years ago, this was all changed. If you put cancel() in the canexit event for a form, to close it you need to say
    parentform.code.canexit=""
    parentform.close()
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    [email protected]

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

    Comment


      #3
      Re: Warning: .close(.F.) and CanExit event

      Originally posted by martinwcole View Post
      several years ago, this was all changed. If you put cancel() in the canexit event for a form, to close it you need to say
      parentform.code.canexit=""
      parentform.close()
      Martin,

      I am not sure I get the point. Since they made the change I was griping about, if you put cancel() in the CanExit event, yes the Windows system X will not close the form, just as it should not, since that is what cancel() is all about. However, your close script does NOT need perentform.code.canexit="" to blank out the CanExit event and close the form. All it needs is parentform.close(). Why? Because a check flag of any value no longer has any effect in the .close() method, so the cancel() [and all else] in the CanExit event will not fire at all, no matter what (unless, of course, you rely only on the Windows system X to close). Anything you had in CanExit would have to go in your parentform.close() button if you want it to be effective. To my mind that is not how it should work, and at some point in the past (v5, v6, v7, v8 or v9) it did work the way I think it should.

      If I am wrong, please correct me.

      Raymond Lyons

      Comment


        #4
        Re: Warning: .close(.F.) and CanExit event

        Just did some checking in V12.

        If you have cancel() in the canexit event of the form, and on a button say a5.close() - it will not close (unless you first say parentform.code.canexit="")
        Cole Custom Programming - Terrell, Texas
        972 524 8714
        [email protected]

        ____________________
        "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

        Comment


          #5
          Re: Warning: .close(.F.) and CanExit event

          Originally posted by martinwcole View Post
          Just did some checking in V12.

          If you have cancel() in the canexit event of the form, and on a button say a5.close() - it will not close (unless you first say parentform.code.canexit="")
          Yes, that's exactly as it should be for a simple A5.close(), i.e. it's what cancel() is all about in a CanExit event. The same should be true for parentform.close() or at least explicitly parentform.close(.F.), but it is not. That is, whereas a simple A5.close() will fire the CanExit event, no simple (by itself) parentform.close() will fire it. I say it used to and still should, and if not then we all need to be aware that parentform.close() will not fire the CanExit no matter what else you do. Thus the code in the CanExit event has to be in the button with parentform.close(). The only reason (I think!) to have anything in a form's CanExit event is so it will fire if the user uses the Windows system X to close the form--or as you point out, so it will fire if you have a button with a simple A5.close(). Or just turn off the Windows system X if you are going to use parentform.close() with whatever was going to be in the CanExit event.

          Also, I suppose one could have something, including cancel(), in the CanExit event that will fire with the Windows system X, and then if you want a button with A5.close() to exit A5 entirely, you would need, as you point out, parentform.code.canexit="" to entirely bypass what is in the CanExit event.

          Raymond Lyons

          Comment


            #6
            Re: Warning: .close(.F.) and CanExit event

            yes
            My approach with all my apps has been to have one form that never ever closes - Master Menu
            if that form has cancel() in the canexit event, then one cannot close alpha from other forms with the X - so the only place to put it is in the Master Menu.

            If I want to close alpha from some form other than the Master Menu, I say

            if is_object(":master menu")
            :master menu.code.canexit=""
            a5.close()
            end if
            Cole Custom Programming - Terrell, Texas
            972 524 8714
            [email protected]

            ____________________
            "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

            Comment

            Working...
            X