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

BAD OBJECT HANDLE

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

    BAD OBJECT HANDLE

    Have a "Menu" form that allows two different data entry forms be used.

    An On-Init event for the "Menu" dimensions a GLOBAL object pointer (frm1, and frm2)for each of the two data entry forms.

    The "Menu" has a button for each of the two data entry forms. Each button has an on-push event that has the following code where the 9 is either a 1 for frm1 or a 2 for frm2.
    If is_object (frm9) then
    frm9.show()
    frm9.activate()
    else
    frm9=form.view("FORM9")
    endif

    When the on-push event runs to load FORM1, I get the "BAD OBJECT HANDLE" when the on-push event runs to load FORM2, it runs without error.

    I have the latest version of A5 running on one pc, this is the version that has the BAD OBJECT HANDLE. On another pc, I have the first unpatched version of A5v5 and it will allow either form to load WITHOUT the BAD OBJECT HANDLE.

    What give with this?

    Thanks
    Barry Shadduck

    #2
    RE: BAD OBJECT HANDLE

    So I said to myself, what gives with this?

    Forms behave one way with old version, and another way with new version. Each behaviour has it's good and bad traits,
    so I guess I decide which of two evil's is lesser, and live with (or more likely, die with) it???????

    Comment


      #3
      RE: BAD OBJECT HANDLE

      Why arent you using action scripting?? The action script will produce the code for you. I have always written native xbasic, but I have been shown just how powerful action scripting really is. Give it a try.

      Tom

      Comment


        #4
        RE: BAD OBJECT HANDLE

        Just a question... Should it be FORM.VIEW("FORM1") or FORM.VIEW("fmr1")???

        I nearly ripped what's left of my hair out yesterday only to find that I had placed an underscore"_" where a space " " should have been.

        Comment


          #5
          RE: BAD OBJECT HANDLE

          Thanks for your reply. frm1 points to whatever I call the form and in the example it is "FORM1".

          Comment


            #6
            RE: BAD OBJECT HANDLE

            Thanks for your reply, but what is action scripting?

            And why does the same very simple code fragment work for one button, but not the other? This is the kind of stuff that drives me up the wall, down the street, and into the nearest saloon, pub, or other beer quafing place.

            Makes no $#*%%ing sense at all. Very very very very hard to debug such inconsistant junk.

            Comment


              #7
              RE: BAD OBJECT HANDLE

              Barry,

              Is it possible you're looking in the wrong place?

              Perhaps there's an error that's occurring in the OnInit or OnActivate events in the called form.

              Do the onPush event scripts in your Menu form's buttons do anything else besides what you've shown us?

              -- tom

              Comment


                #8
                RE: BAD OBJECT HANDLE

                Very weird, but if you post your code for the menu form maybe there may be something there that your eyes are not finding, and give a chance for more eyes to inspect it.



                Mario
                The Mexican
                The Mexican

                Comment


                  #9
                  RE: BAD OBJECT HANDLE

                  Thanks for your reply,

                  Found that a "this.newrecord()" statement that works fine
                  in the unpatched v5.0, generates a bad object handle in the latest patched version.

                  So I will stumble along some more and see how far I can go before I fall down again.

                  Comment


                    #10
                    RE: BAD OBJECT HANDLE

                    Thanks Mario, before I am finished with this little app,
                    (been working on it on and off from version 4.5 to present version, for two years or so), I may need to post the app as you suggested.

                    Thanks for your reply.

                    Comment


                      #11
                      RE: BAD OBJECT HANDLE

                      Hello Tom,

                      Yes the error does occur in the OnInit of the called form in the updated A5 version, however in the non-updated version, the code works just fine.

                      What I am trying to do is use the recommended object pointers. A menu form checks for an existing object (is_object), and when not found, assigns the form name to the object.

                      Then, the ON-INIT event of the called form uses a .new_record()function to put the non-menu form into data entry mode. This is where I get the BAD OBJECT HANDLE in the updated A5 version (no matter how I address the .new_record() function). The old version will let me use absolute addressing for the function, but not an object pointer.

                      Is there a standard way to do this, and my method is not one of them? Is there any documentation on working with forms using xbasic other than the chapter on XBASIC METHODS FOR OPENING FORMS AND BROWSES? If not there should be in my opinion, as there is much more to using forms than opening them.

                      My frustration level is getting very high at this point, I am hoping that I do not have to download some sample database, and study it to get my stuff to work. I like to use documentation to find my way, but that requires documentation that is comprehensive, and accurate.

                      Thanks

                      Comment


                        #12
                        RE: BAD OBJECT HANDLE

                        Barry,

                        It's difficult to troubleshoot your forms when they haven't been posted.

                        In the onInit event script for the called form, use THIS to reference the form itself.

                        THIS.new_record()

                        If you're using a reference to a pointer for the form defined in the CALLING form, the variable scope for the pointer is probably wrong. Unless you declared the pointer variable global in the calling form, it's local, and the called form (and it's onInit script) can't see it.

                        In my own work I don't use the OnInit event of the CALLED form to begin the new record. I let the OnPUsh button script from the calling form do it.

                        I check to see if the form is already open.
                        If it's open the OnPush script checks it's mode.
                        If it's VIEW then the same script begins the new record.
                        If it's not VIEW then I warn the user.
                        If it's not an open form, I LOAD it.
                        I set the desired index.
                        I begin the new record.
                        I show the called form.
                        I activate the called form.

                        -- tom

                        Comment


                          #13
                          RE: BAD OBJECT HANDLE

                          Thanks Tom,

                          I do use GLOBAL object pointers. Since the documentation is getting me nowhere, if you could paste one of your ON-PUSH events into a reply, I'm sure it would be very helpful to me.

                          By the way, was using this.new_record() and it was ok for old A5, but not for the new A5. At any rate I will take your advice, and remove code from oninit event of called form. Had it there because I was able to make it work there before I installed new version.

                          Thanks

                          Comment


                            #14
                            RE: BAD OBJECT HANDLE

                            Barry, unzip the attachment to an empty folder.

                            The example database I've attached illustrates several different ways to open a new form and pass values to a new record begun there.

                            I suggest you study the option to

                            Manipulate Objects on the Called Form

                            that you'll find on the Main menu.

                            This illustrates how to do it from the calling form, using absolute addresses in the one case, and object pointers in the second.

                            Hope you find this useful, it's an adaption of stuff I've posted in the code archive long ago.

                            -- tom

                            Comment


                              #15
                              RE: BAD OBJECT HANDLE

                              Thanks, it did help. At least I got rid of the bad object handle, will attribute the success to using form.load() instead of form.view().

                              Now I need to recind my previous comment on documentation, as I see there is a small chapter on Xbasic Methods for Working with Forms and Browses.

                              Comment

                              Working...
                              X