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

Leaving tables open with a dialog

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

    Leaving tables open with a dialog

    I have a form that calls another form in dialog mode like this:

    DIM numbers as P
    numbers = :Form.load("DealNumbs","dialog")
    numbers:tables:NAMES.filter_expression="ACCT = '" + acct.TEXT + "'"
    'numbers:tables:NAMES.order_expression=""
    numbers:tables:NAMES.query()
    'numbers.show()
    numbers.activate()

    As you can see, I have tried several different methods to close this form without success. If i go to check the indexes after this form is opend and data maniplated. Alpha informs me the table is still open. I can then close alpha and restart to go again.

    If I open and close this or other forms set up the same way, I get a message that something is wrong and I have to close alpha and restart the machine to continue.

    I have win2000 professional, amd 1.4ghz, 256meg mem, 40gig HD with 25 gig free. I have shut all else off and there is no network to cause issues.

    Any help would be appreciated.

    Dave Mason

    #2
    RE: Leaving tables open with a dialog

    As mentioned in the other thread,

    Check the sections on form.load(), form.dialog(), and form.open() in the Xbasic Ref. Manual.

    -- tom

    Comment


      #3
      RE: Leaving tables open with a dialog

      David,

      I apologize. I've been been pointing you a section of the reference materials that's only slightly useful. Try Ch. 22 in the Xbasic Ref. Manual. The section on 'Closing a Dialog Box' explains things in detail. -- tom

      Comment


        #4
        RE: Leaving tables open with a dialog

        Tom,

        I think you are not understanding this problem, so please do not direct me to those pages anymore. I read all of them in detail before I voiced my problem here and I hope someone else may have a better idea of this problem.

        I will add that when I open 7 dialog forms and close them, the eigth one causes a problem. Is there a deep problem in A5 that leaves the forms hidden in some way rather than closing them???

        I generally get this kind of response when the problem is unsolvable. I will find my own solution as I generally do , if necesary.

        Thanks any ways.
        Dave

        Comment


          #5
          RE: Leaving tables open with a dialog

          David,

          Sorry my ideas were not more helpful.

          If you want to post a working example that illustrates the problem, with step by step instructions on how to trigger it, I'll be glad to look at it. Perhaps others will as well.

          -- tom

          Comment


            #6
            RE: Leaving tables open with a dialog

            David,

            At the risk of irritating you further, I offer the following.

            If I were writing your script I would add one more line :

            DIM numbers as P
            numbers = :Form.load("DealNumbs","dialog")
            numbers:tables:NAMES.filter_expression="ACCT = '" + acct.TEXT + "'"
            'numbers:tables:NAMES.order_expression=""
            numbers:tables:NAMES.query()
            'numbers.show()
            numbers.activate()
            Code:
            :DealNumbs.close()   'or numbers.close()
            _
            For the reasons explained in the various passages I've
            referred to before. If this last line is missing from your
            scripts, that may explain why your forms, opened in dialog
            mode, are remaining open.

            -- tom

            Comment


              #7
              RE: Leaving tables open with a dialog

              David

              Your opening script seems fine. However, As Tom points out you must explicitly close a dialog opened with form.load(). This has caught many programmers. To quote from page 177 of the xbasic manual

              "Contrast this behavior with the Form.view() and Form.load() methods when the �Dialog� parameter is specified. In this case the user action of closing the dialog actually only hides the window so that the Xbasic program can read any of the variables that the user filled in on the dialog box. It is the responsibility of the Xbasic programmer to use the close() method to actually close the window."

              The last sentence is the key. You must have a close() statement in the script that called the dialog after the dialog runs to close the dialog.

              Using your code, which seems correct, make this change

              DIM numbers as P
              numbers = :Form.load("DealNumbs","dialog")
              numbers:tables:NAMES.filter_expression="ACCT = '" + acct.TEXT + "'"
              numbers:tables:NAMES.order_expression=""
              numbers:tables:NAMES.query()
              numbers.show()
              numbers.activate()

              '-- At this point the script pauses until the user "closes" the dialog, which only hides it. Add this to actually close the dialog.

              numbers.close()

              '-- This actually closes the dialog.

              By the way, if this code is in the dialog events or button, it won't work. It MUST be in the calling script or a script on the form that called the dialog. The dialog has to be "closed" (hidden) by the user before this will work.

              Even this could fail if the dialog can't close for some reason. An example would be if the dialog is left in enter or change mode. You can add some xbasic to check and place it in the CanExit event for the dialog.

              Now I do see a problem if you are opening a dialog, then opening another dialog from that one, and then opening another dialog form the second dialog, etc. You will end up with a bunch of forms open, even though they may be hidden. This could eventually cause a crash if the same table is opened each time.

              I have one application that does this to a limited extent, and I found a couple problems. Since dialogs are modal, you shouldn't be able to do anything on any other form until the dialog is "closed". That is true of the first dialog opened. However, if a second dialog is opened from the first, it isn't completely modal. You can still access the first dialog, which isn't what you want. I also found that I could only have a maximum of 3 dialogs open before I started having problems. It took a number of workarounds to get around the problems. If I could have gotten the effect the user wanted any other way, I would not have used multiple dialogs.

              Jerry

              Comment


                #8
                RE: Leaving tables open with a dialog

                Thanks to both of you. I might also add that the show and activate are not BOTH needed. In fact, when using both, they cause the forms to open up on the screen 2 times.

                Thanks again

                I will try this

                Dave

                Comment


                  #9
                  RE: Leaving tables open with a dialog

                  Dave,

                  You are correct about the show() and activate(). Actually, the main issue is the order in which they run. The activate() should come before the show(), since the show() statement opens the dialog. If the activate() command is after the show(), the activate will try to display the form again. I usually include the activate() line, even though the code seems to work fine without it.

                  Jerry

                  Comment


                    #10
                    RE: Leaving tables open with a dialog

                    Jerry,

                    Thanks!!! It seems to work like this:

                    DIM layout_ptrR as P
                    layout_ptrR = :Form.load("DealRebates","dialog")
                    layout_ptrR:tables:NAMES.filter_expression="ACCT = '" + acct.TEXT + "'"
                    layout_ptrR:tables:NAMES.order_expression=""
                    layout_ptrR:tables:NAMES.query()
                    layout_ptrR.show()
                    'layout_ptrR.activate()


                    :DealRebates.close()

                    I am not sure that I need the activate at all. I am leaving it out as I learned many years ago to not include anything not needed.

                    I had tried the last line before, but must have done something wrong. It now works and it does not lock the table so far.

                    Dave

                    Comment


                      #11
                      RE: Leaving tables open with a dialog

                      Dave

                      I see you got it working. One thing that may have happened is that a previous instance of the form may have still been open when you ran this code. If the form is open, and you try to open it again, Alpha assignes an alias to the new instance. For example, if "DealRebates" was already open, your code would open a form with the alias name "DealRebates1". Your close statement tries to close the original instance called "DealRebates". However, if that form is locked, it won't close and now you have 2 versions open. Each time you opened a new dialog, it left all previous versions open. If that is the case, I am surprised you got to 8 times before it locked!

                      You already have some of what you need to get around this. You created a table pointer for this instance with

                      layout_ptrR = :Form.load("DealRebates","dialog")

                      Layout_ptrR is the pointer that "points" to this instance. Now instead of using the form name in the close statement, use the pointer.

                      layout_ptrR.close()

                      This WILL close this instance.

                      Comment

                      Working...
                      X