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

Mystery Multiple Sessions

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

    Mystery Multiple Sessions

    My main menu screen is based on a dummy table "Main_menu". On my main menu I have a multistate button and a conditional object that is controlled by a variable passed from the multistate button. On the multistate button are two buttons SALES and QUOTES. When you press SALES the conditional object displays a "Record Entry" Button and a "Record Editing" Button. The Record Editing button contains the following script in the onpush event:

    'Opens Sales form for editing
    this.disable()
    vmode="Edit"
    f=:Form.load("EESALES","dialog") 'Browse form only not for entry or editing
    f:Tables:SALES_ORDER.filter_expression="quote_status=.f. .AND. orderstatus='Opened'"
    f:Tables:SALES_ORDER.order_expression=""
    f:Tables:SALES_ORDER.query()
    f.activate()
    f.restrict_enter=.t. 'no entry at form level
    f:browse1.allow_change(.f.)
    f.show()
    f.close()
    vmode=""
    this.enable()
    END

    If you press the QUOTES button on the multistate button the conditional object displays a button that reads "Edit Quotes" the Onpush event uses the same script as above except that the filter expression is "quote_status=.T. .AND. orderstatus='Opened'"

    In my application I can change the status of a sales order to a quote by changing the "Quote_status" field from an "F" to a "T".

    By pressing SALES on the main menu and then "Record Editing" I get a form containing a browse that lists all open Sales Orders then by pressing QUOTES on the main menu and then pressing "Edit Quotes" I should get the same form listing all Sales Orders that have been changed to "QUOTES". The problem is that pressing SALES then "Record Editing" gets me what I expect but after closing the EESALES form and arriving at the main menu I find that Pressing the QUOTES button and then the "Edit Quotes" gets me the result of the previous operation. The program seems to ignore the new filter expression. If I exit the form and press the QUOTES and "Edit Quotes" button again I get what I am expecting. I can't figure out why it doesn't respond properly to the first button presses while responding properly to the second button presses.

    I did notice that the system created a second session on the mainmenu object. Perhaps it is getting confused? And by the way how do you shut down these extra sessions without closing A5.


    #2
    RE: Mystery Multiple Sessions

    Greg:
    when you first start the app.
    the main menu appears.
    go to the menu bar and select window.
    are there two main menu listings?

    If so
    are you using a autoexec to open the form?

    If so
    go to control panel
    file
    database properties
    see if there is a form loading on start.
    if you use an autoexec then you may not want any forms to load on start
    This will give you 2 instances of the main menu
    Charlie Crimmel

    Comment


      #3
      RE: Mystery Multiple Sessions

      Greg,

      Without knowing what is happening in various scripts, it is very difficult to determine where the error may be. One possibility is that your first form opened as a dialog isn't actually closing. I have found that script errors in events for dialogs can prevent the form from closing, even though the script line f.close() would normally close the form. The fact that the mainmenu form is opening a new session would indicate that you have a command that opens a new instance of the menu, perhaps when the dialog form tris to close? The only way I know to close the extra sessions is to close and reopen A5.

      Posting a zipped copy of the app with the offending forms would give more information.

      Jerry

      Comment


        #4
        RE: Mystery Multiple Sessions

        Further to the mystery, when I initially open the EESALES form by pressing SALES on the multistate button and then "Record Editing" I get a quick flash on the screen as the form loads up and then immediatly disappears. Then it immediately returns to the main menu and the "Record Editing" button stops responding. But if I press on the QUOTES button on the multistate control the "Quote Editing" button is operational but again it gives me the result of the previous filter. Please note that I have used "this.disable()" and "this.enable()" in my code.

        Comment


          #5
          RE: Mystery Multiple Sessions

          This happens when I open the main menu from the control panel. I have no autoexecs set up yet. There is nothing loading on start.

          Comment


            #6
            RE: Mystery Multiple Sessions

            Greg, can you establish a pointer to the query that's being run when your dialog form opens? If so, perhaps you need to drop the query after that form closes. A pointer to the query list should permit you to do a query_pointer.drop() statement.


            Your description of the sequence makes me wonder if Alpha Five isn't trying to be helpful by using the last query, instead of noting the differences in your filter expression.


            I don't have much practice creating queries using the Tables object of the form that's being opened, so I don't know if you can establish a pointer, or whether it's possible to force the query list to be rebuilt. Both could be done with code that runs in the dialog form when that form opens... I'm just not sure if you can do it from the calling form, as you are attempting...

            -- tom

            Comment


              #7
              RE: Mystery Multiple Sessions

              greg:
              Sounds like you might have to zip up all of your files and post them on the board so we can take a look.
              Charlie Crimmel

              Comment


                #8
                RE: Mystery Multiple Sessions

                Here is the zip file. Man I was looking at the size of the SEM and DDM files and they are bigger than I thought. The overhead required to run these things is huge. Anyway play around with it. I think the combination of a multistate button and conditional objects is really slick.

                Comment


                  #9
                  RE: Mystery Multiple Sessions

                  AARRGHHH! I pressed the send button only to realize that there is a maximum size of 1 meg! My stripped down maximum compressed winzipped files add up to 2.7 megs. Doesn't this seem a little restrictive? Anyway perhaps I can send this off via direct e-mail.

                  Comment


                    #10
                    RE: Mystery Multiple Sessions

                    Mystery solved!
                    There were a number of problems here.
                    First I had put in a number of button hide and formatting commands in the Oninit event of the EESALES form. I guess there were some syntactical errors in the script which I still havn't resolved. The errors or whatever was causing all the multiple sessions to appear (how can something so simple and common so much havoc). But anyway I figured out how to hide buttons and change text in buttons from the Form load command involked by the main menu buttons (I wish someone could do up a description of how to invoke methods and change object properties from forms, buttons, events etc. the colons and relative/absolute addressing stuff is totally confusing for a neophyte like me).

                    Second, the problem with the QUOTE button appearing to use the previous expression as opposed to the expression I coded into the Form load command. The reason is simple as it turned out there were no records that satisfied the filter condition. Once I put a .T. value into the quotestatus field of one of the records in the sales_order table everything worked fine. I later created an index for the table that included records where "quotestatus" was .T. and "orderstatus" was opened. Then within the form load prodcedure I did an index_primary_put() followed by an IF statement followed by a record_get() to check for the condition when no records satisfy the filter. If no records are found I exited the script.

                    Thanks for the help! But it is nice to solve a humdinger by yourself every once in a while.

                    Comment


                      #11
                      RE: Mystery Multiple Sessions

                      The following is an Email from Jerry Brightbill that shed a great deal of light on the problems I was having:

                      I spent some time with your application and found a number of issues and
                      problems.

                      1. It appears your data dictionaries have become bloated and possible
                      corrupted. Run database compact frequently, especially during
                      development. As an example, your sales_ord_detail.ddm file was over 2.7 megabytes which is very large (huge actually). After compacting, it was less than 8 kb.

                      2. It is dangerous to name a table and a set with the same name. This
                      can cause all kinds of problems when you use xbasic to open tables, etc.

                      3. After cleaning up the field rules to eliminate lookup references to
                      non-existent files, and compacting the database, I found that the
                      problem you describe does occur.

                      4. The OnInit script for the eesales form was crashing. By adding some
                      error trapping code, I found the problem was in the object addresses
                      being referenced. You need to include a reference to the form object. Page 96 in the xbasic manual describes the problem. Since the form would crash on loading, it stayed open. This is one of the unexpected behaviors of
                      dialogs. Errors on loading just leave a copy of the form open without
                      being shown on the windows list and no error being displayed. My error
                      trapping would pop up a message only when I closed A5. As more and more copies were opened, eventually A5 runs out of memory and the computer crashes. Even closing A5 didn't release all of the memory.

                      5. Here is the code I ended up with on the eesales OnInit event. It
                      seems to work cleanly.


                      'Changes button text
                      if var->Vmode="Entry" then
                      PARENTFORM:button3.hide()
                      PARENTFORM:button4.hide()
                      PARENTFORM:SO_title.text ="Sales Order Entry Form"
                      PARENTFORM:Button23.text="Edit Sales Order"
                      ' PARENTFORM:button23.activate()
                      else if var->Vmode="Edit" then
                      PARENTFORM:button3.hide()
                      PARENTFORM:button4.hide()
                      PARENTFORM:SO_title.text ="Sales Order Edit Form"
                      PARENTFORM:Button23.text="Edit Sales Order"
                      ' PARENTFORM:button23.activate()
                      else if var->Vmode="Quote" then
                      PARENTFORM:SO_title.text ="Quote Edit Form"
                      PARENTFORM:Button24.text ="Cancel Quote"
                      PARENTFORM:Button23.text="Edit Quote"
                      ' PARENTFORM:button23.activate()
                      end if
                      END

                      One thing I do like is the use of the conditional on the menu. It sure
                      does allow the use of many options in a small footprint.

                      Good luck with your project. Hope this gets you on the right track.

                      Jerry

                      Comment

                      Working...
                      X