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

Proper Table Referencesin Set

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

    Proper Table Referencesin Set

    I have a button on the second tab of a form that is used to edit invoices. The first tab displays an invoice parent. The second tab displays the invoice detail items in an embedded browse. When I highlight a row on the browse and press the button; The following script runs:

    ******************************************
    ''Edit invoices Script this opend a read only browse
    parentform.hide()
    this.disable()

    tbl = table.get("invoice_detail")

    vsoRec = tbl.recno()
    f2 = :Form.load("invdetpop","Dialog")
    f2:TABLES:invoice_detail.filter_expression = "between(recno(),"+str(vsoRec)+","+str(vsoRec)+")"
    f2:tables:invoice_detail.order_expression = ""
    f2:tables:invoice_detail.query()
    f2.resynch()
    f2.show()
    f2.close()
    vmode=""
    this.enable()
    parentform.resynch()
    parentform.show()
    :Invoice_Fm:Browse1.Refresh()
    END
    ************************************************

    The problem is that on a WIN95 machine I get that "MAximum Stack Depth exceeded" message after pressing the button and bringing the form up 3 times for editing. On an NT machine the message shows up after pressing the button 5 times. Any ideas?


    #2
    RE: Proper Table Referencesin Set

    Dang, Pressed the button too soon.

    I was wondering if Each time I press the edit button that I am generating another instance of tbl and that may be what is causing the error.Should I close tbl? Maybe I could find another way to reference a value to shove into vsoRec.

    Note: "invoice_detail" is a member of the set that the main form is attached to.

    Comment


      #3
      RE: Proper Table Referencesin Set

      I vaguely recall having problems with dialog forms opened as you describe, although I can't remember the details just now.

      try this:
      have a global variable [RNUM] used for record number
      in the dialog form, go to properties and filter and put
      recno()=var->rnum
      assign a record number to your variable and just open the form as a dialog

      Comment


        #4
        RE: Proper Table Referencesin Set

        William,

        I have had the same problem and tried many approaches and ended with the same solution. The problem is that it takes too long to run the query. The result is that the form opens so slow that it is easy for the user to keep clicking, resulting in multiple queries trying to run and the stack error message.

        Setting a global variable and filtering the dialog form on the variable is by far the fastest and best solution. On one form I use, the time to open a dialog went from a few seconds to almost instantaneous.

        Jerry

        Comment


          #5
          RE: Proper Table Referencesin Set

          Greg,

          The potential problem of users pressing a button multiple times is a known problem both for fast acting scripts and slow ones. User frustration and the normal double click can both lead to unintended multiple button presses. This problem can be prevented by adding a line to defeat the second button press by deactivating the button. The line of code might be: This.Disable() from my lost notes.

          This allows the process to run until it completes where you place a second line of code to enable the button again, This.Enable(). The button may grey out while this code is running.

          Dave

          Comment


            #6
            RE: Proper Table Referencesin Set

            I am confused here, I use the :Form.load("invdetpop","Dialog") command to call up a dialog form, is there another way to call up a dialog form?

            Comment


              #7
              RE: Proper Table Referencesin Set

              don't say form.load("xx")
              say
              f=form.view("xx","dialog")
              and set the filter properties on the dialog form as described above.

              Comment


                #8
                RE: Proper Table Referencesin Set

                thank's Jerry - I couldn't remember the details - just that I had made a rule for how I opened them - whether as a dialog or regular.

                Comment


                  #9
                  RE: Proper Table Referencesin Set

                  Form.view doesn't give me any flexibility to adjust the appearance of objects in the form. Does this mean that I have to make separate almost identical forms?

                  Comment


                    #10
                    RE: Proper Table Referencesin Set

                    Greg

                    Attached is a sample showing how this works. You can certainly use form.load("formname","Dialog). I normally use this even if I am not trying to manipulate anything on the dialog form. In the sample, I dimmed the variable on the OnInit event for the inventory form. The dialog opens by doubleclicking a rom in the browse.

                    Jerry

                    Comment


                      #11
                      RE: Proper Table Referencesin Set

                      I am still confused. I can't understand the difference between your code and mine. You reference your recno from the form value in the OnInit event. and I get mine from a table reference within the OnPush event of a button. You get your popup using the onrowdoubleclick event of the browse and I do it with a button.

                      What is bothering me is that I can't get a fix on what is causing the error message problem in my code. I do a lot of cutting and pasting, this flaw can be all over the place.

                      Comment


                        #12
                        RE: Proper Table Referencesin Set

                        I declared the global variable in the OnInit event since it has to be declared somewhere and this was convenient for the example. I would normally declare (dim) all globals in an autoexec script. I set the value of the variable in the doubleclick event. Your method to set the variable value should also work. You could use the same script used on the doubleclick on a button.

                        I have a couple philosophys that usually keep me out of trouble. Keep it simple, if it works, use it, and don't fix what ain't broke. The method I posted works.

                        Jerry

                        Comment


                          #13
                          RE: Proper Table Referencesin Set

                          Greg,

                          Maybe this will help.

                          I took Jerry's example, and extended it to show you how I'd approach it using a query run in the called form, in the same manner you were doing.

                          Unzip the attachment to a separate folder. Do not mix it with your development work.

                          You'll find Jerry's example, and two new forms (both of which have names which end with the numeral '2'):

                          I've removed the global variable and the filter from both, and implemented your approach, with revisions I've learned
                          are usefule. Explanatory notes are at the end of the script.

                          Let me know if you have questions.

                          -- tom

                          Comment


                            #14
                            RE: Proper Table Referencesin Set

                            By the way, both Jerry and I run a month behind, which is why we've named our zip files with a reference to August, instead of September. Concerning September both he and I are in denial.

                            -- tom

                            Comment


                              #15
                              RE: Proper Table Referencesin Set

                              Thanks Tom, is the f2.activate() really needed? I have left this out of a lot of my scripts. Could you tell me why it is needed? I noticed that I have a resynch() in my script, could this be the culprit that is giving me the error?

                              Comment

                              Working...
                              X