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

Progressive Lookup

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

    Progressive Lookup

    Using Jim Chapman's approach in the June newsletter for a progressive lookup, keylist_build is too slow for the 10K record table that I must use for a progressive lookup display - say a couple seconds for each key press.

    A standard table lookup field rule would work if I can figure out how to get the lookup value on return from the lookup.

    Lookup is from a child browse. Entering a new record and lookup is initiated by a OnRowDoubleClick, so on return from the lookup (myform.OnActivate) :Browse1:myfield.value has the value of whatever row was double clicked, not the row that is being added.

    The new row is added correctly. Focus looks like it is on the new row. I just have not figured out how to address it to get the value returned by the lookup. All form and table addresses I have tried give the last row double clicked, not the added row.

    Bill.

    #2
    RE: Progressive Lookup

    Hello Bill,

    Yes, it is quite slow when dealing with a large table or over a network connection. I have had several correspondances on this issue, and a couple of weeks ago Al Buchholz brought this up again, and I decided to try to find a faster approach and re-visit this issue. Al and I went back and forth on this issue. This turns out to be a little stickier of a problem that I origionally thought. You can use a regular form and the onKey() event, as Peter Wayne has described on his site www.learn alpha.com, to dynamically filter and display a progressive lookup. This is quite fast if you use a pre-defined index.

    On the Xdialog front, I am not aware of any way to dynamically/progressively determine the filter of the keyList_build() function without another query. We can however load the entire key list of an index into memory. This is quite fast, and I have made some progress on the Xdialog approach. On an old 1 gig system, slow HD, 768 megs Ram, I can load 24,000 records into memory in less than a second, then I can progressively filter these in a Xdialog box. However, that still doesn't answer the real problem. What happens when the table is 100,000 records, 1 million, over a slow network, etc.

    There is one piece to this puzzle that would make the routines I have been playing with much quicker, and that is the ability to scroll an Xdialog list box 'to the top'. I can easily progressively scroll an Xdialog list box, but the current record selection is at the bottom of the list. To make it scroll (a misnomer as it doesn't really scroll) to the top I have to re-filter the list every time the user enters a character, hence replacing the current list rather than scrolling through the existing list.

    Any thougths?

    Jim

    Comment


      #3
      RE: Progressive Lookup

      jim,
      what i have done in an analogous situation is to read in no than than 20 records at a time -- the number i want to show in a listbox. this is very fast, no matter how many records you have, as long as the table is properly indexed. i think it would be fairly straightforward to adopt it to a progressive lookup, but the keylist_build() would have to be abandoned.
      - peter

      Comment


        #4
        RE: Progressive Lookup

        Jim

        I have wrestled with this issue also as I use a keylist_build for my calendar addin. Other that using an index with the same expression as the keylist expression, I have found no way to speed up building the list. The only "solution" is to make the expression as simple as possible - one or two fields and no trimming of fields. This helps somewhat, but not much. A change made a while ago by Alpha did increase speed and stability, but it still can be slow with big files.

        Jerry

        Comment


          #5
          RE: Progressive Lookup

          Hello Peter,

          Thanks for the thoughts. I have been trying this approach, although I have been reading in 100 records at a time. The issue that bothers me about this approach is that the user could choose to scroll after a few keystroke entries and hit the end of the subset of records.

          I suppose one could 'train' the users to always enter keystrokes, but in a situation where the user is not totally sure of the spelling, scrolling usually becomes the perferred approach.

          If there was a way to know where the current 'scroll' in the Xdialog list box was I might be able to anticipate this.

          I have also been toying with the idea of beginning the process with a subset of records, say the first 100, and at the same time start a seperate thread that continues on reading the entire table (limited to a couple of fields per record) into memory. The problem with this is that if the table is large enough.......not good ...... so the script itself might make a decision, if the record count is 100,000 continue to do just subsets of records.............. don't like this either.........

          Thoughts?

          Thanks,
          Jim

          Comment


            #6
            RE: Progressive Lookup

            Hello Jerry,

            Thanks for the thoughts. I have come down to three potential approaches:

            1) Using the indexPointer.key_list_get() function. This is quite fast and allows me to just get a subset and define a beginning point for the subset. But the question remains, how fast is fast enough for a large table or over a network.

            2) Using table.external_record_content_get() which is pretty fast and easy to use.

            3) Just opening a table in Xbasic and do queries on it via a predefined index, then using the result to populate the list box. Most flexible but ends up being a ton of queries (even with LQO) against an open table.

            Thoughts?

            Thanks,
            Jim

            Comment


              #7
              RE: Progressive Lookup

              Jim

              I would suspect that any find that uses an index or subset of an index(indexPointer.key_list_get()) will be the fastest method. Any method that uses a query will be somewhat slower, although LQO may reduce the difference. I haven't run any tests on large tables, but I wonder if using
              table.external_record_content_get() and then populating a list will be any faster then keylist_build() that populates the list directly. They both appear to use similar query syntax, so finding the records should take about the same time.

              Any fast method relies on having an index in place, which restricts the usage a bit. If you don't already have an index to fit the search, then either you have to create a number of extra indexes, which has it's own issues, or you have to take the speed hit of a query. Maybe all of this will become moot when V6 comes out and we can use a SQL structure that only uses queries.

              Jerry

              Comment


                #8
                RE: Progressive Lookup

                Jim & Bill,

                Peter's suggestion is actually the only practical suggestion that works in a networked environment.

                When you do a lookup, get the 1st n entries, and place the data on the display. As a user types keys, fetch the n entries based upon the new keys. Trap the scroll up/scroll down/Page Up/Page Down/Home/End etc, and get any additional record data you would need either just before or after those currently displayed.

                It may behoove you to grab a few extra entries just before and after the displayed range, as the response may be more acceptable when you scroll if you already have adjacent records (or +/- pages of n entries) already in memory. I would scroll to the new display of the record, then fetch additional entries while the user views the newly displayed data.

                If you can invoke a separate thread to get the data around the current record as you receive keystrokes, you may be able to get the needed records as fast as required, even on a slow machine, by fetching the number of records based upon the current queue of keystrokes, and bypassing intermediate display refreshes if you get behind in data fetching.

                I would not, however, get more records than are needed for fast response. This adds additional load to the network and data sharing, and may slow down all users.

                Regards,

                Ira
                Regards,

                Ira J. Perlow
                Computer Systems Design


                CSDA A5 Products
                New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                CSDA Barcode Functions

                CSDA Code Utility
                CSDA Screen Capture


                Comment


                  #9
                  RE: Progressive Lookup

                  This is an interesting thread, although I admit most of it is beyond my capabilities. However it would seem that a range might do the trick, you could progressively vary the range so it changes the displayed records, and the results should be quick since it uses an existing index. Won't work in SQL but might for now.


                  Russ

                  Comment


                    #10
                    RE: Progressive Lookup

                    Russ

                    To use a range, you still need an index. While ranges are still supported, the trend is toward queries. LQO queries are typically almost as fast as a range, since they use an existing index.

                    Jerry

                    Comment

                    Working...
                    X