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

'RUN ON LOAD' PROBLEM

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

    'RUN ON LOAD' PROBLEM

    I have an application that consists of a main table and a main menu form based on that table, a table (with associated form) that was 'Added' to the database and two libraries that I added which contain two functions I programmed.

    My problem is, when I set the 'RUN ON LOAD' option to the form associated with the table I 'Added' I get all kinds of errors. (i.e. Action Program Error - Trapped error in action command [1] Command: Inline xbasic Error: not found) Eventually I get an illegal operation message, Alpha5 caused an invalid page fault in module A2CRDSYS.DLL at 0177:0093e3bl.....)

    When I set the Main Menu form that is associated with the main table to 'RUN ON LOAD', I don't get any errors. Can I not 'RUN ON LOAD' a form that is added to a database? Can I only 'RUN ON LOAD' a form that is based on a table created in my application?

    #2
    RE: 'RUN ON LOAD' PROBLEM

    Scott,

    Check the events OnActivate, OnFetch, or OnInit for the new form you are trying to use. Sounds like you have some action scripting on a form event that may be trying to find a table, script, or form that doesn't exist in this app when you open the form. From the error, you have something on an inline xbasic script that is failing.

    Jerry

    Comment


      #3
      RE: 'RUN ON LOAD' PROBLEM

      I failed to mention that if I manually run the first form that calls in the second form, it runs without a problem. As soon as I turn on the RUN ON LOAD function, it bombs out.

      I did a little more digging right after I posted my question and found that using an AUTOEXEC script and executing a form.view command is helping a little. I now get a different error, but the error can be OK'ed and the application continues to work without getting an "illegal operation" message.

      The new error I'm getting is:

      Script: Autoexec line:1
      :form.view("StartupScreen")
      internal error; cannot recover

      Do you know how to get rid of this error?

      Comment


        #4
        RE: 'RUN ON LOAD' PROBLEM

        Scott,

        If you search the forum for "internal error" you will find a number of posts about this problem and many different possibilities. As your original error indicates an error exists in an inline xbasic script, you really should check all scripts that run on events for the form. Since the form was probably created when the table was attached to a different app, there may be some hard coded paths in the action events. This would certainly cause errors. The fact that it causes an error when opened with an autoexec script must be investigated as something is still wrong.

        A question I forgot earlier. Does the form open ok from the control panel? And does it work as expected?

        There are a couple things you can try. First, if there are any scripts on OnInit, OnActivate, or OnFetch for the form, put "end" on the first line. This will prevent any of the script from running. While you have the script open, press F4 to be sure the script compiles and there are not syntax errors. Compact the database to clean up the table dictionaries. You could try duplicating the table to another table name and see if the new table works. It is possible you may have a corrupted form. Try creating a new form similar to the original and see if that opens. Save the form under a different name and eliminate all event codes and scripts an see if that works.

        One thing I prefer to do is avoid action scripting, Sure it is a quick and easy way to do thinks, but I don't care much for the error trapping. I may initially create code with it and then convert it to xbasic without the error trapping. Then I use the following to give more information about the error

        'first line of the xbasic script
        on error goto error_handler

        'at the end of the script
        End
        error_handler:
        msg = error_text_get(error_code_get())+chr(10)+chr(13)+"Error occured at line "+str(error_line_number_get(),4,0)
        ui_msg_box("Error", this.name()+" - "+msg)
        end

        This will give more detail about the error and what line it falls on. The only errors I have found that it won't trap are errors in user functions. Sometimes, the function script fails and the script just stops running.

        If all else fails, zip up the app with the tables and some dummy data and post it here. Someone should be able to track down the error.

        Jerry

        Comment


          #5
          RE: 'RUN ON LOAD' PROBLEM

          I'll try your suggestions (thanks....) but I will answer your one question. "Does the form open ok from the control panel?"-Yes. Everything works great! (That's why this has me so puzzled.)

          I'll post the results of your tests when I get a chance.

          Comment


            #6
            RE: 'RUN ON LOAD' PROBLEM

            Scott, where did the 'added' table come from? Was it created by Alpha Four or Five in another folder? Was it created by another application altogether? I'm wondering if the 'added' table is legal? Is it a Foxpro 2.6 format?

            -- tom

            Comment


              #7
              RE: 'RUN ON LOAD' PROBLEM

              Scott:

              You wrote, "I failed to mention that if I manually run the first form that calls in the second form, it runs without a problem. As soon as I turn on the RUN ON LOAD function, it bombs out."

              By what exact means does the first form "call" the second?

              Bill
              Bill Hanigsberg

              Comment


                #8
                RE: 'RUN ON LOAD' PROBLEM

                Tom:

                The added table was created in A5 in another directory.

                Comment


                  #9
                  RE: 'RUN ON LOAD' PROBLEM

                  William:

                  What I mean by that is the first screen loads and then 2 seconds later, I have have an Action Script run that executes the following commands running under the ONINIT method:

                  frm=:form.view("MainMenu")
                  :QNBSplashScreen.close()

                  This displays the second screen (the main menu) and closes the first screen (the splash screen.)

                  Comment


                    #10
                    RE: 'RUN ON LOAD' PROBLEM

                    Scott,

                    If this script is on the OnInit for the first form, you are trying to close it before it opens. And where does the 2 seconds come from? If you are using sleep(2), this will just pause all script actions. I suspect you want to first form to display for 2 seconds and then have the second form come up. This is a perfect case for using the OnTimer event.

                    Move the line to open the second form to the OnTimer event for the first form and set the timer interval to 2 sec. On the OnActivate event for the second form, place the line to close the first form. This should do what you want.

                    Jerry

                    Comment


                      #11
                      RE: 'RUN ON LOAD' PROBLEM

                      Ok. Thanks for the advise!

                      Comment


                        #12
                        RE: 'RUN ON LOAD' PROBLEM

                        Scott:

                        This is no criticism of Jerry's advice but let me suggest another approach to managing a succession of forms: place the code in a autoexec script.

                        I have an application which has to do a bunch of things to initialize itself including loading a bunch of forms and creating user defaults. It runs over a network. Consequently, the process is not instantaneous. To placate my users I provide an opening screen which a series of messages informing them of what's happening and how much longer they will have to wait. (It's not really that long!)

                        All of this is extremely easy to control if you put it in an autoexec since all the code is in the same place. In my opinion, run on load is a simple device best reserved for uncomplicated situations.

                        Bill
                        Bill Hanigsberg

                        Comment


                          #13
                          RE: 'RUN ON LOAD' PROBLEM

                          This sounds like a good solution. I'll give it a try.

                          Thanks!

                          Comment

                          Working...
                          X