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



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

Zooming to Record from Browse

  • Filter
  • Time
  • Show
Clear All
new posts

  • Zooming to Record from Browse

    I was having issues with "Zoom to a Record" which occasionally would throw out an error or go to the wrong record, so I wrote my own...

    dim sptr as P
    DIM GLOBAL getrecordnum AS N
    getrecordnum = a5_eval_expression("=recno(\"rcardetail\")")
    sptr = Form.load("Rental Car Edit","dialog","","Center","Center")
    Every once and a while I still get the wrong record to show in the form. I am using shadowed network workstations for this app and was wondering if anyone else had this issue. Rebooting the machine seems to help which led me to believe its a corrupt index. I am trying a test to flush the index on workstation via a button but I have to wait until it happens again to see if this could be the culprit.

  • #2
    Re: Zooming to Record from Browse

    Are you saving the record first before this script runs so you are sure you are in view mode on the parent form?

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford


    • #3
      Re: Zooming to Record from Browse

      Originally posted by MoGrace View Post
      Are you saving the record first before this script runs so you are sure you are in view mode on the parent form?
      Yes, the browse is read only. Users can only enter from a single record form. This is only to edit the record in the browse. I also have multiple users, could this have some effect perhaps?


      • #4
        Re: Zooming to Record from Browse


        You're calling the edit form as "dialog". This requires special handling in your script. Check the help file discussion of the LOAD method of the FORM object for details. Unless they've changed something in the last version your calling script must explicitly close the dialog form. User closing the dialog's window does NOT release it from memory, or close the table(s) that were opened when the edit dialog is opened.


        • #5
          Re: Zooming to Record from Browse

          Use pointers rather than eval with a table name, it makes assumptions
          curecn=table.current().recno() ' guaranteed the record in focus
          'Then best to check if there is an already open form and get or give it a pointer
          dim pfod as p
          if is_object("Rental Car Edit")=.f.
          	pfod=form.load("Rental Car Edit") ' dialog or whatever you like
          	pfod = obj("Rental Car Edit")
          end if
          pfod.Recno_goto(curecn) 'makes the specified record number current.
          like Tom says - you may otherwise not be closing and then opening multiple instances of the form.
          Last edited by Ray in Capetown; 12-19-2014, 07:30 AM.


          • #6
            Re: Zooming to Record from Browse

            Here's a link to the help file material.

            The "Dialog Style" notes are critical. The example code (closing the dialog form explicitly) should be used every time a form is opened as Dialog.

            -- tom


            • #7
              Re: Zooming to Record from Browse

              Tom are you simply assuming that John with minimum 7 years experience with A5 and running forms as dialog hasn't yet read the instructions for using that option.
              I presume the opposite and that the reliability issue is relating to the code being used and not leaving forms open.
              That using
              getrecordnum = a5_eval_expression("=recno(\"rcardetail\")")
              will expose one to that kind of event (where for whatever reason, there is more than one copy of the form open)


              • #8
                Re: Zooming to Record from Browse


                I know nothing about John's experience, and certainly did not mean to offend.

                The code John posted at the beginning of the thread omitted a vital statement, closing the dialog form. His script, as displayed for us, was dangerously incomplete. I was simply trying to help, did not mean to imply that closing the open dialog form was responsible for his troubles. To may way of thinking he had two problems. One he knew about, and one he apparently did not. Your criticism of my efforts illustrates again the oft quoted principle that no good deed ever goes unpunished.

                I won't bother to respond further.


                • #9
                  Re: Zooming to Record from Browse

                  Tom you are the standards setter and stickler to good practices and he who goes the extra mile to help, never ever even suspect any offense taken on my part.
                  I feel comfortable enough through many years of communications with you on and off the board to challenge. I hope not to offend you.
                  The intention was to not underrate a potential flaw in the actual code of John's that is a little subtle, if indeed John has still not resolved his issue.
                  I do tend to make a judgement on what level to reply to a poster based on what I know of their previous posts and failing that, the date of joining.


                  • #10
                    Re: Zooming to Record from Browse

                    Guys, can't we just get along. I appreciate both your comments and I know that after 20 years experience with alpha back to the DOS days, that I still know very little. I have learned everything from this board and my attempts to read the documentation. As most of you know I am a pilot by profession and although I can run he systems on a Gulfstream 550 Alpha still eludes me many times. Both Ray and Tom, I really appreciate your input over the years and it helps so much. I can't tellyou the satisfaction of having try to get something to work for two days and then being able to post something and actually getting some help.

                    I have been laid up the last couple of days with a severe bronchitis and I could not get to my computer to try some of your suggestions. I know I close the form from the form itself but I am not sure of the methodology besides a regular form close. I know if the user gets out of Alpha and gets back in the problem clears itself. I am double-clicking from a browse which should guarantee me the proper recno , But I think I see your point that perhaps if another form is open it may not be going to the record number on that particular form but on another that maybe hidden. Unfortunately, I am out this week but really want to fix this issue. My users get to suffer while I enjoy Christmas. Thank you both again very much, And I hope you have a happy holiday.


                    • #11
                      Re: Zooming to Record from Browse

                      Immediately following the "" statement the dialog has been hidden. If you want code access to the hidden dialog you have, until you close it with


                      • #12
                        Re: Zooming to Record from Browse

                        here is something simple
                        in the browse, where you are on the row containing the record for which you want to open the form
                        dim global rnum as n
                        f=form.viewqueried("the form name","recno=var->rnum","","dialog")
                        Cole Custom Programming - Terrell, Texas
                        972 524 8714
                        [email protected]

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


                        • #13
                          Re: Zooming to Record from Browse

                          Martin, I tried your code but got a field does not exist.

                          Ray, I was closing the dialog form with a parentform.close() from the dialog that opened. I never noticed it until I had a tabbed display that the form was still open and I suspect as you all have suggested that this is the culprit. If I add sptr.close() in the onrowdoubleclick event, it indeed lets me manipulate the form which I still close and then when control is returned to the main form with the browse, the form is really "closed" and does not appear in a tab. I never knew that using .close() right after a .show() would not close the from right away. It makes sense given it is a dialog. I learn every day. I think this will fix the problem but time will tell. Thanks all.


                          • #14
                            Re: Zooming to Record from Browse

                            should have been:

                            f=form.viewqueried("the form name","recno()=var->rnum","","dialog")
                            Cole Custom Programming - Terrell, Texas
                            972 524 8714
                            [email protected]

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


                            • #15
                              Re: Zooming to Record from Browse


                              Thanks, I tried that but did not get a window to open. I will play with it some more. What do you think about the methodology of the two. They are similar, and I will have to see which one is faster.