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

autoexec not firing

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

    autoexec not firing

    I have created timed scripts to run at night.

    script_schedule("Rebuild Indexes","11:24")
    script_schedule("NOP Inv 1","11:25")
    script_schedule("NOP Inv 2","11:29")
    script_schedule("NOP Sales 1","11:31")
    script_schedule("Rebuild Indexes","11:35")

    I just put the times to current time so i could watch them fire and make sure they are right, but they aren't firing? I am in the control panel of a database that I built to always be open on the server. It only has the tables attached that are affected by the above scripts. What am I missing.

    Thanks for your time,Lynda

    #2
    RE: autoexec not firing

    Lynn,

    From the Control Panel,
    select View, Settings...

    Check that
    System, Prefernces, Autoexec Script, Execute the Autoexec Script ... value: YES

    Comment


      #3
      RE: autoexec not firing

      I have check this and it was blank. So I put to YES, saved, closed and re-opened the db. Autoexec still did not execute. i have executed each script and operation that is scheduled to run and they all fire ok. Just can't get the autoexec to fire....

      Comment


        #4
        RE: autoexec not firing

        script_schedule() only replays a specific script, so you
        should probably just include a
        script_play("autoexec") as he first code line in all your
        scheduled scripts.

        Comment


          #5
          RE: autoexec not firing

          I'm not sure I understand. I want to fire several scripts throughout the night. That is why I have used the schedule() with a time. So that they each fire, one-at-a-time, with plenty of time inbetween so they don't collide. Can you not tell scripts within the autoexec when to fire? Or can I not have several in the autoexec? Sorry, I don't understand, but if you could suggest what you would do, I'd appreciate it...

          Comment


            #6
            RE: autoexec not firing

            Hi Lynda,

            I tried your method for one script and it worked fine. I didn't try to get a second script to fire. Do you get one script to work at all?

            The obvious thing that sticks out with me is the autoexec spelled correctly?

            Just a thought.

            Dan
            Dan Blank Databases, Inc.
            Dan

            Dan Blank builds Databases
            Skype: danblank

            Comment


              #7
              RE: autoexec not firing

              Lynn,

              You stated the problem is that the autoexec script is not
              executing. However, as you now describe it, that is not the
              case. It is actually a matter of the scheduled scripts not
              executing if you have the autoexec as follows:

              'autoexec
              script_schedule("Rebuild Indexes","11:24")
              script_schedule("NOP Inv 1","11:25")
              script_schedule("NOP Inv 2","11:29")
              script_schedule("NOP Sales 1","11:31")
              script_schedule("Rebuild Indexes","11:35")

              ==========================================
              Is that correct?

              I presume of course that you insure A5 stays running overnight.

              However, the crux of the matter is in the documentation
              for script_schedule:
              To wit:
              "There are ten timers available (1 - 10). If no parameter is specified timer 1 is used. There can only be one script assigned to each timer."

              So perhaps if you amend the code to"

              'autoexec
              script_schedule("Rebuild Indexes","11:24", 1)
              script_schedule("NOP Inv 1","11:25", 2)
              script_schedule("NOP Inv 2","11:29", 3)
              script_schedule("NOP Sales 1","11:31", 4)
              script_schedule("Rebuild Indexes","11:35", 5)
              ==========================================

              the problem should be solved.

              If it still fails, after opening the database
              try going to interactive and checking with
              script1 = script_schedule_name_get(1)
              script2 = script_schedule_name_get(2)
              script3 = script_schedule_name_get(3)
              script4 = script_schedule_name_get(4)
              script5 = script_schedule_name_get(5)

              Comment


                #8
                RE: autoexec not firing

                I knew it was something simple! THANKS....

                One last question if you don't mind. I have built a DB for just the autoexec features that will stay open on the server. That way I can force it to open when the server reboots each night, and then run my scripts. I have not attached all tables to this DB, just the ones that are used in the scripts. However, I want the indexes to rebuild each night. If I don't attach all tables, will the "Rebuild Indexes" scripts only run on those attached? I'm assuming if I want all tables to reindex at night, I'll have to add all tables to the DB? Is this accurate?

                THANK YOU AGAIN
                Lynda

                Comment


                  #9
                  RE: autoexec not firing

                  To answer your second (ie: "one more") question, it would
                  seem logical you would need to attach all tables in the
                  Rebuild_Indexes script, so there is no problem as to what
                  tables are refereneced.

                  Now some suggestions.
                  1. Make sure you force all users off Alpha Five to insure
                  there is no conflict. See

                  http://www.learn alpha.com/ShutDownNetwork/ShutDownNetwork.htm

                  I believe that answers another question of yours. :)

                  2. Make sure the second DB is also inthe same directory as as 1st (application) DB. That will make it easier to resolve table locations.

                  Happy to have helped,
                  Melvin

                  Comment


                    #10
                    RE: autoexec not firing

                    Thank you for all the information and assistance

                    Comment


                      #11
                      RE: autoexec not firing

                      Looks like Melvin got you fixed up with the scheduling. I might suggest a change to your logic. Why not schedule the first script

                      script_schedule("Rebuild Indexes","11:24")

                      Then have its last line (of "Rebuild Indexes") be

                      script_play("NOP Inv 1")

                      whose last line is

                      script_play("NOP Inv 2")

                      and so on.

                      Or make the last lines of "Rebuild Indexes" be

                      xbasic_wait_for_idle()
                      script_play("NOP Inv 1")
                      xbasic_wait_for_idle()
                      script_play("NOP Inv 2")
                      xbasic_wait_for_idle()
                      script_play("NOP Sales 1")
                      xbasic_wait_for_idle()
                      script_play("Rebuild Indexes")
                      end
                      There can be only one.

                      Comment


                        #12
                        RE: autoexec not firing

                        Actually, you could enhance it even further to make it more
                        generic, and simpler.

                        Make a table call sheduled_scripts

                        FIELD Type Width Decimal
                        Script_order N 3 0
                        Script_name C 20

                        make an index "Script_order" = Script_Order
                        Then you could make a Batch_Script as follows:
                        ====================================
                        'Batch_Script
                        dim num_scripts as N
                        dim curr_script as N

                        btbl = table.open("sheduled_scripts")
                        btbl.index_primary_put("Script_order")
                        num_scripts = btbl.records_get()
                        FOR curr_script = 1 to num_scripts
                        btbl.fetch(num_script)
                        xbasic_wait_for_idle()
                        script_play(btbl.Script_name)
                        curr_script = curr_script + 1
                        NEXT
                        ====================================

                        Then you wouldn't have to modify the code if you
                        needed to add or delete a script, or change the order
                        all you need is

                        script_schedule("Batch_Script", "21:00", 1)

                        in the autoexec script :)

                        Comment

                        Working...
                        X