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

Here's a challenge...

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

    Here's a challenge...

    I have a form with a text box and a record-list box.

    The text box is tied to a form-level (Layout) variable, not a field in the database.

    As the user types in the text box, I need the record in the record-list box that most closely matches the string the user is typing to become highlighted.

    In other words, if the user is going to type the name "Nickerson", as she types, here is what should happen.

    N Napster should be highlighted in the record-list box.
    i Nibert should be highlighted in the record-list box.
    c Nicard should be highlighted in the record-list box.
    k Nickerson should be highlighted in the record-list box.

    Finally, either pressing enter or double-clicking on the highlighted record in the record-list box should write the name "Nickerson" or better yet, the Account ID for the "Nickerson" account to a variable so I can take further action upon that variable.

    Clear as mud?

    Any help would be most appreciated.

    p.s. I need to do this in a form, not an X-Dialog if possible.

    Louis

    #2
    RE: Here's a challenge...

    Louis,

    Jim Chapman has a newsletter article describing how to do what you want in xdialog. I would think his methodology could be adapted to a form.

    Do you agree?

    Bill
    Bill Hanigsberg

    Comment


      #3
      RE: Here's a challenge...

      Bill,

      Thanks for the response.

      I might be able to adapt an X-Dialog script to do what I need.

      Do you have any idea which newsletter it was that had the article?

      Best Regards,

      Louis

      Comment


        #4
        RE: Here's a challenge...

        Louis,

        Vol 1 #16 June 2003, "Create Progressive Lookups in Seconds with Action Scripting"

        There is a good tutorial. Once I understood the underlying idea I was able to use raw xdialog create something very useful.

        Bill
        Bill Hanigsberg

        Comment


          #5
          RE: Here's a challenge...

          Louis,

          Here is a screen shot.

          The button on the calling form filters the xdialog to 20003 which is the third term of 2000 known to ordinary mortals as fall 2003.

          The shot shows that when the user types 387 they are (always within fall 2003) taken to department 387. Typing more would send them to a particular course within 387.

          Since the variable in the typin field is scoped as shared it persists so the next time the user calls the xdialog they are at the same place in the list, bookmarked, as it were.

          Runs fast over a network filtering about 10k records which was a pleasant surprise.

          Bill
          Bill Hanigsberg

          Comment


            #6
            RE: Here's a challenge...

            Bill,

            Very nice work!

            Thank you for directing me to Jim's newsletter article. I watched his Turbo Demo tutorial and the proverbial light is now burning bright.

            I do think I will be able to adapt this to a form. Since the variable tied to the textbox (on a form) is apparently not updated until the textbox loses focus, I will try to update the search string using the OnKey event of the form.

            Any additional thoughts/advice are welcome.

            Best Regards,

            Louis

            Comment


              #7
              RE: Here's a challenge...

              Hi Louis,

              " I will try to update the search string using the OnKey event of the form."

              That's what occurred to me. I hope this doesn't make the form jumpy. Nothing else to do but try.

              Bill
              Bill Hanigsberg

              Comment


                #8
                RE: Here's a challenge...

                Bill -

                I ran on to this while looking for a similar function for myself. And I had a question since it looks like you have played with this a bit.

                Is your lookup all one field?

                Can this be made to lookup across multiple fields?
                For instance my DB has hundreds (thousands?) of "smiths" and I would like to be able to type "last_name,firstname" and have it look up just like it does with only last name.

                Additionally if I could type a partial name when I don't know spelling that would even be better! ie, "smi,james" would locate / filter the names beginning with "Smi" and a firstname of "James".

                Any light you could shed would be appreciated. My efforts so far have failed.

                I may also try and locate Jim Chapman's address to as him.

                Thanks!

                Scott

                Comment


                  #9
                  RE: Here's a challenge...

                  Scott,

                  Take another look at the xdialog and it will be apparent that the typin is not even a whole field. Rather it is a substring of the left-most field. There are two variables at play here and the filter is on the first plus the second:

                  The user is searching within a particular term. From this I create the first variable such as 20003 or fall 2000;
                  When the user types 387 the search is done on "2003387".

                  If it simplifies things you should not hesitate (in my opinion) to add a field to the table on which your lookup is based. Then you just search on the field and it is fast.

                  So far I have evaded your direct question about whether an Xdialog can search over multiple fields. I actually do not know off the top of my head. Probably yes but I whould have to bury myself in the documentation. It is a good question and I am glad you asked it.

                  In my example I had that long concatenated field for other reasons so I just used it.

                  Bill
                  Bill Hanigsberg

                  Comment


                    #10
                    RE: Here's a challenge...

                    Bill -

                    Thanks for the quick reply.

                    I kind of answered my own question with partial sucess:
                    You can search across multiple fields.

                    If I put the following expression in the vSelect variable

                    (alltrim(Lastname)+","+alltrim(Firstname)) >= Var->vTypeIn

                    it will look up the lastname then the firstname after I place the comma ",".
                    so if I type "smithr" it will pulls up "Smithson James" if I type "smith,r" it will pull up "Smith Robert"

                    I had the syntax wrong when I first wrote you.

                    I think that I could do a partial look up with some more work using substr() with an at() to locate the position of the "," in the expression string above. The problem I see now is I might have to add another variable to test the two, otherwise how can I get a substring of the variable I'm typing? Any ideas?

                    Thanks again!

                    Scott

                    Comment


                      #11
                      RE: Here's a challenge...

                      Sorry about the formatting on the last message.

                      The html got me!

                      Scott

                      Comment


                        #12
                        RE: Here's a challenge...

                        Scott:

                        You might consider indexing your field on "remspecial(fieldname)" which ignores punctuation. That way your users do not need to type commas and hyphens.

                        I may be dense but when you write:
                        "The problem I see now is I might have to add another variable to test the two, otherwise how can I get a substring of the variable I'm typing?"
                        I don't get what the problem is. If you want to search on the combined value of the two variables can't we just concatenate them. Are you saying we need a 3rd variable to hold the concatenated value. I can't recall if I had to do that without reviewing my code.

                        But I think I must be misunderstanding you.

                        Bill

                        PS A tree that grows 10' per year sounds like an animal!
                        Bill Hanigsberg

                        Comment


                          #13
                          RE: Here's a challenge...

                          You might consider indexing your field on "remspecial(fieldname)" which ignores punctuation. That way your users do not need to type commas and hyphens.

                          In this case I want my users to type the comma AND I would like that to be the signal to Alpha to 'jump' to the next field for more information.

                          In other words if I typed "sm,r" the filter would bring up all names that had a lastname starting with "sm" and firstname starting with "r".
                          The progressive lookup continues in lastname until I type the comma then the letters I type continue in the firstname field.

                          If I use remspecial(lastname+","+firstname)and I type "smithr" it will return "smithrobert" but I still have to type the full lastname. What Im trying to do is work around spelling errors etc as well as reduce keystrokes by doing a partial lookup on the lastname.


                          I may be dense but when you write:
                          "The problem I see now is I might have to add another variable to test the two, otherwise how can I get a substring of the variable I'm typing?"
                          I don't get what the problem is. If you want to search on the combined value of the two variables can't we just concatenate them. Are you saying we need a 3rd variable to hold the concatenated value. I can't recall if I had to do that without reviewing my code.


                          Up till now all I get when I use the substr() is a blank in the lookup. It never finds the ',' I guess because the variable is empty until I fill it in (Clear as mud?)So I was thinking of using a concatenated field to use as the lookup field and just displaying the lastname and firstname fields.


                          PS A tree that grows 10' per year sounds like an animal!
                          Kind of off subject but:
                          You must be a bit of detective as well as and "Alpha Person". :-) Where did I leave that little tidbit laying around? They are great trees and I started the company out with an Alpha 4 v3 DB before I had it moved to a Progress client/server application when I needed better networking than I felt Alpha had at the time. I never did totally leave Alpha though. It still had / has ease of use that the Progress will never have. IMO. I'm excited about V6 - we may move totally back to Alpha if it does what I hope it will.

                          Thanks again for all your input.

                          Scott

                          Comment


                            #14
                            RE: Here's a challenge...

                            Louis -

                            I hope some of this is helping you. I didn't mean to take over your thread. I'll move else where if you would prefer.

                            Scott

                            Comment


                              #15
                              RE: Here's a challenge...

                              Scott,

                              I think I see what you are trying to do.

                              You might want to look at the at() function in the xbasic documentation. That will find where the comma is and then you may be able to do something with the two parts of what the user has typed.

                              Bill
                              Bill Hanigsberg

                              Comment

                              Working...
                              X