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

Error: invalid table handle

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

    Error: invalid table handle

    Have been this running a report for years. Suddenly I get the error message that tdailyrpt.enter_end() is invalid. The code is 510 lines, the enter _end is line 508.
    Going backwards. V7 seemd to have problems that couldn't be resolved. Went back to V5 (latest version on Windows 2000). Suddenly, the report doesn't run. It will run in V7 with the exact same coding. The next line closes the table, but if I comment the enter_end, I get the same invalidtable handle for the close.??? Two steps forward, three back.
    Have compacted any number times. Exited and returned. Cold boot and return with no change in the sudden appearance of the error message.
    Dick

    #2
    Do you have an "xbasic_wait_for_idle" anywhere in your code?
    Finian

    Comment


      #3
      No. They're practically all just moving data from one table to another for a report.
      I believe I found the problem; however the solution appears to be non trivial.
      As I mentioned, there were 510 lines. I restored an earlier version with fewer than 500 lines in the script, around 476, as I recall. Since I really need the 510, I started adding lines, about 6 at a time. The report ran fine each time, until the last successful run at 497, I believe. Added a few more, and it went South. Once the error appears, it appears cast in concrete. Specifically, I have backed down to 467, mostly by moving comments from separate lines to the end of lines. Still, no matter how few lines I get down to, the error appears. Compacting does not help.
      I don't recall ever seeing anything about a 500 line limit. I'll break it down into two scripts, one calling the other. However since it now seems "tarred and feathered", I'm not sure this will provide the solution. Will give it a shot. If the two pieces don't work, guess it'll be back to an earlier version and again add the lines for the umpteenth time, in two scripts.
      Dick

      Comment


        #4
        Dick, good luck unscrambling this. Years ago I remember threads (a5v4 or a5v5 forum) where folks were hitting a script length limit in the code editor. If memory serves it was in the vicinity of 1,000 lines, but folks finally decided that it was not a line limit, it was a total character limit. Don't recall more recent threads discussing this, and don't know if the editing buffer has been extended in more recent releases. Thought I'd mention it in case you wanted to do a bit of searching.

        In my own work I try real hard to limit scripts to one typed page each. This is about two screens full, or a bit more. If I'm going beyond that I'll break it down into separate scripts or functions. Have found that it's easier to trouble shoot and easier to maintain. Using custom (UDF) functions also helps to eliminate timing issues with scripts that keep working even though earlier processing has not been finished.

        -- tom

        Comment


          #5
          Thanks Tom. I did break it downinto two scripts. The first is 353 lines. Midway (?) it calls the second, which is 130 lines. A total of 483 lines.
          You're probably correct about the number of characters vice lines.
          Rather than "breaking" in the middle, guess I'll try just splitting it in two, i.e., sequentially and see if that works. Conceptually, I'm not sure if there is a difference, but what the heck, I'll give it a shot.
          Thanks again Tom.
          Dick

          Comment


            #6
            Nope. Only a total of 318 lines now. Comments moved to places following statements. (Part 1). Still get invalid table handle (running only the first piece).
            Copy script to notepad. Delete script. Compact. Exit program. Create "new" script from "old" code. Apparently, once the error label is attached. There's no getting rid of it.
            Good thing I'm on the first level, so junping out the window won't cause any harm.
            Dick

            Comment


              #7
              Eliminated all comments. Same story, "invalid table handle."
              Dick

              Comment


                #8
                Dick, if you'll put the comments back in perhaps some of us will be able to help troubleshoot your script. We'll need the database, and instructions from you on where to look to find the script. A narrative description telling us, step by step, what you want your script to actually do, will also be needed.

                -- tom

                Comment


                  #9
                  Will try and put it together as you suggest. Keep checking it as I go along, removing comments, and then suddenly it's back to the error message.
                  It'll be at least tomorrow before I get it posted here.
                  Thanks again Tom.
                  Dick

                  Comment


                    #10
                    DailyRpt "Backup" provided. I have the db in c:\dailyrpt.
                    1) "H" on the main menu will take you to the form Sales & Marketing
                    2) For testing, step 1 may be omitted and go directly to the Sales & Marketing form (in Control Panel from Code to Form tab). Select "B" CME Daily. Enter '8' for the week (the last available), and your initials, or blank for the 'Send To'. Not sure how I got the request for the week in twice, or if it's necessary twice. The report should run. Since we're at the begining of a "new" week, the first two sections will be blank. I've left out the header with the customer's name, etc.
                    3) Although the form has been run for several years, a modification is required. The reason - the butter
                    market has expanded to include Tuesdays and Thursdays. Formerly it was only active on Monday, Wednesday, and Friday. The table has been expanded to account for the new fields required.
                    a) The script will be found in the code tab under "DailyStat". Adding the necessary code apparently
                    takes it to too many lines, or as Tom Cone suggested, possibly too may characters. However, once it
                    "blows", because of 'invalid table handle' tdailyrpt.enter_end()), it appears stuck on that error message, no matter how much backtracking is done.
                    b) I've included a "from here" to "to here" as a suggestion where the script might be broken into two
                    pieces. (DailyStat2 which would be called (Script_play() ).
                    c) The 'Bdays' (Butter Days) is no longer necessary. It and references to it can be removed. Further,
                    the checking code for the day in the butter section may also be removed.
                    d) Without the comments, it would be a real headscratcher looking at the code at a later date.
                    e) As the week goes on, the market may be checked daily after noon. "K" on the main menu will do it.
                    Unfortunately, while it will provide the data, the form will open, but the data will not be entered, as it's
                    supposed to do. In V7, I can also get the butter, but it also does not fill in the fields on the form. As mentioned earlier in the thread, problems have caused a retrograde back to V5. Of course you can fill in the dailymkt manually after joting down the numbers. Or of course you can make up your own, e.g., through Wednesday to see how the first two sections are working.
                    Hopefully, the foregoing provides all the essential elements of information. If not, to avoid cluttering up the thread, you can email me at [email protected].
                    Thank you.
                    Dick

                    Comment


                      #11
                      Week 7 can be entered at the button to fill in the first two sections.
                      For testing, it's faster to use the "Run" icon in the Design mode of the script.
                      Attached is a zipped file of the script with many of the Tue & Wed expressions in place. It aborts with the invalid message. Provided for possible copy and paste rather than typing.
                      Dick

                      Comment


                        #12
                        Will try attachment again.
                        Dick

                        Comment


                          #13
                          Thanks to Tom Cone, I'm well on the way to a workable report. Per his suggestion, I'm breaking the original long script into a number of pieces. As the task proceeds, everthing seems to appear on course. The report is generated and so far has not aborted.
                          Thanks again.
                          Dick

                          Comment


                            #14
                            I'm reasonably certain that the problem is not the length of the script or the number of characters. I have a number of 1000 line + scripts that run without problem. I seem to recall Cal Locklin also saying that he had several of over 1000 lines.
                            Finian

                            Comment

                            Working...
                            X