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

Using Locate_next function

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

    Using Locate_next function


    I am trying to use the Onkey Event for the locate by
    form function using the "L" KEY, but I want to be able to ask for the next record using the locate_next function. I need to know,what I need to add, so i don't have to use the
    mouse to press the find key again on the find by form
    dialog box. I want to use the keyboard only and not
    the mouse.

    ***************** Below is my xbasic *******************

    if upper(a_user.key.value) = "L" then
    tbl = table.current()
    if tbl.mode_get() > 0 then 'change or enter is pending so suppress the find
    end
    end if

    if this.active() = "Name" then 'user is entering a name, suppress the find
    end
    end if

    ' script gets here only if user pressed L and form is not in change or enter mode
    ' and user is not entering a name

    a_user.key.handled = .t.
    this.LOCATE() 'begin LOCATE BY TEXT
    end
    end if
    end

    #2
    RE: Using Locate_next function

    I see no one has responded, so I will take a crack at it. To use locate_next you would need some way to trap the values the user enters in the find text form and I don't see any way easy to do that, other that trapping every key stroke and that would be very messy. However, there are other options. One would be to design your own locate form that looks like the A5 form and use global variables for the search value and the search options selected. Then use locate_next() or locate_prev() and the trapped variable values for the search.

    Another option is to message boxes to set the initial values and then use locate. The following is a script I use on a form which is a browse table of hazmat restrictions. Now most of your key strokes are the ENTER key. More key strokes, but better control over the search values. find_val is a global variable.

    find_new:
    if find_val ""
    response = ui_msg_box("Find","Find "+find_val+" again?",UI_QUESTION_SYMBOL+UI_YES_NO)
    if response = UI_YES_SELECTED
    goto find_it
    end if
    find_val = ""
    end
    end if
    fld = ui_get_list("Select Column to Search",1,"Material Desc & Shipping Names","UN Number")
    fld = left(fld,1)
    select
    case fld =""
    end
    case fld = "M"
    search_fld = "table_172_101->Proper_Ship_Name"
    title = "Enter Name to Find"
    case fld = "U"
    search_fld = "table_172_101->Un_Number"
    title = "Enter Identification Number to Find"
    end select
    find_val = ui_get_text("Find",title)
    if find_val = ""
    end
    end if
    dir = 1

    find_it:

    direction = ui_get_radio("Search Direction",dir,"Find next","Find Previous")
    if direction = "Find Previous"
    :Hazardous_Materials_Tbl.locate_prev(find_val,search_fld)
    dir = 2
    else
    :Hazardous_Materials_Tbl.locate_next(find_val,search_fld)
    dir = 1
    end if
    goto find_new
    END

    After you find the first match, hitting ENTER again will find the next (or previous) value and so on.

    Jerry

    Comment


      #3
      RE: Using Locate_next function

      JERRY

      I Will try some of your ideas and I appreciate your
      help. It was difficult for me to go from Alpha4 to
      Alpha5, Where in Alpha4 You could assign a barscript
      for my keys, for enter,find,locate,run a script,etc.I rather
      use the "keyboard" than the mouse.I have work with Alpha5
      now for 3 years, and I know it can do more things than Alpha4.

      Tom Cone has help me assign "Onkey events" for Enter,Query by Form, and Locate By Form.

      Thanks for the Help

      JAMES

      Comment


        #4
        RE: Using Locate_next function

        James,

        The one thing I really miss from the A4 days is the ability to quickly trap key stroke sequences. I agree, that was much easier. As for using the keyboard and OnKey events for actions, I also initially thought that was easier than searching with the mouse. But, I found that many users have grown up in a GUI environment and prefer point and click. So who am I to argue with "progress"

        Jerry

        Comment


          #5
          RE: Using Locate_next function

          Your problem is an interesting challenge. Attached is a litle app that shows one way you can achieve what I think you want. I used the built in customer template to create a customer form. If you press L, a dialog form will popup which is a look alike to the standard locate dialog, except this one traps all of the values in global variables. After you find the first time, just use N to find the next matching record and P for the previous. This will work with the dialog opened or closed. I trapped the N and P keys in both the dialog and the main form. Every time the form is initially opened, the values are cleared. Every time L is pressed, default values are entered.

          Jerry

          Comment


            #6
            RE: Using Locate_next function

            JERRY

            Thank you,thank you,thank you very much. I work your XBasic into my program and it works fine. I have a multilevel database set.where I might be looking maybe for a specific fastener like a screw,bolt etc.This will really help me by pressing "N" for the next item.I know a lot of people have got use to using the mouse more, put key entry is quicker to me, and If I had this message board 3 years ago,I would have advance along further than I am now.

            Thanks again.

            JAMES

            Comment


              #7
              RE: Using Locate_next function

              Personally, I don't like trapping single key strokes, but prefer key combinations. Using mode_get() may not always trap the key appropriately, since in modeless entry, the mode only changes after a change has started. I now prefer the using function allow_editing() in v4.5 since this is only true if editing is restricted for a form or browse.

              Jerry

              Comment

              Working...
              X