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

To cancel a fetch?

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

  • To cancel a fetch?

    Anyone know how to cancel a fetch if the user uses the pageup and pagedown keys on the keyboard? We have a situation where we have to make sure that an action has taken place before the user leaves the current record. We have all bases coverd with the exception of the keyboard fetch monster! The OnFetch action in the form actions only seems to fire after the fetch so it is of no use in this matter.
    Any ideas?
    Jeff

  • #2
    RE: To cancel a fetch?

    Hello Jeff

    This is just an idea and may not be appropriate in your case. We have a form where we were having a similar problem, so I prevented (cheated) the use of page up and page down to navigate through records. Instead the user was forced to navigate using custom made buttons. You could check the required action has been completed using the button before fetching the next record.
    The code to prevent the page up and page down is as below :

    if a_user.key.value="{PGDN}" then
    frm1.fetch_prev()
    elseif a_user.key.value="{PGUP}"
    frm1.fetch_prev()

    I know this is not actually prevented the fetch, although it will keep the user on the same record until they use the newly created buttons.

    I hope this helpd a little.
    Cheers
    Tom

    Comment


    • #3
      RE: To cancel a fetch?

      Jeff, the way I deal with it is at the onkey, if the value is pgup or pgdn, and a flag/variable adding="Add" i tell them to finish entering the new record, or cancel it.

      at the onactivate event i have a lot of code that fires, but if they are adding - adding="Add" - i put an end. This way if they caused a dialog or lookup or whatever to fire, when they come back to the form, if the onactivate fires i trap and stop the code from firing if they are adding a record.

      while you can also check the mode of the form, i prefer the global variable adding, as i do a lot with it based on them adding a child record with another form, etc.

      if you don't want to give them feedback, you can just say end
      Cole Custom Programming - Terrell, Texas
      972 524 8714
      martin_w_cole@msn.com

      ____________________
      "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

      Comment


      • #4
        RE: To cancel a fetch?

        Thanks Tom and Martin, Thats what I was looking for!
        Jeff

        Comment


        • #5
          RE: To cancel a fetch?

          Jeff,

          If the record is currently in enter or change mode (you could force the change mode by changing something) then you could trap it on the CanSave event or similar. If it is not in tose modes, then the OnFetch can return the record back to the record it came from. When you do this, you must set flags indicating whether you want Onfetch to return to the previous record, and when you actually do return the previous record, you must set a temporary flag that get's set until you complete the previous fetch (otherwise it will loop forever)

          Regards,

          Ira J. Perlow
          Computer Systems Design & Associates
          csda@mediaone.net
          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


          • #6
            RE: To cancel a fetch?

            Tom, This script works great but has a problem if you are on the last record. We have restrictions for fetching into a new record. If we are on the last record and page up the script hits a dead end returns to second to last record. Do you have a way around this?
            Jef

            Comment


            • #7
              RE: To cancel a fetch?

              Ira, Do you know if the OnKey scripting uses different rules. It seems that you are unable to use a goto in a case or if statement or use the end command. The script seems to continue from line to line regardless of instructions to end or skip to the end. I have code that reads:
              if a_user_key_value="{PgUp}" then
              t = table.current()
              t.fetch_next()
              if t.fetch_eof() = .T. then
              ui_msg_box("","End of file")
              goto stop
              end if
              end if
              'other stuff here
              stop:
              end

              The script will display the End of file message box but then go on the the 'other stuff here. It does not skip to stop:?

              I tried your suggestion but cannot get the OnFetch event to return to the previous record.

              Thanks,
              Jeff

              Comment


              • #8
                RE: To cancel a fetch?

                Jeff,

                I don't believe ONKEY does operate any differently than other scripts. There are two possibilities I suggest you look at.

                1st, STOP is an XBASIC command. Change it to something other than the name of a command. Command words (which may or may not be truly reserved) are bad choices to use except where they are actually used.

                2nd, there is a idiosyncracy that Tom Cone (I believe) found with the RESUME Labelname syntax. It may be similar in operation here. Basically, it is advisable to always have a real line (not a commented or blank line) of code after a goto label, else the code may be interpreted incorrectly.

                For example,


                GOTO Label1

                Label1:
                a=1
                END


                Regards,

                Ira J. Perlow
                Computer Systems Design & Associates
                csda@mediaone.net
                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: To cancel a fetch?

                  Jeff,

                  Also, show me the code that you wrote for the ONFETCH code. You may have not written it in the method I was trying to describe to you and may effectively be fetching twice effectively not moving the record at all. Also, try putting trace.writeln() statements into the code and then view the results in the trace window to see what happens. Debug does not always work great for tracing ONKEY and ONFETCH events.


                  Regards,

                  Ira J. Perlow
                  Computer Systems Design & Associates
                  csda@mediaone.net
                  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

                  Working...
                  X