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

xBasic vs Saved Operations

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

  • xBasic vs Saved Operations

    Has anyone done any work comparing the processing speed of performing operations(updates, appends, queries, etc.) using straight xBasic vs. having xBasic execute a saved operation. I have always created saved operations and strung them together to perform complex batch operations. I have a particularly lengthy batch operation that I am working with and I am wondering if using straight xBasic would speed it up dramatically, but I don't want to take the necessary step of learning the xBasic required if I'm not going to get a lot of bang for the buck. There is plenty to learn and I want to spend my time where I'm going to get the most benefit.

    Thanks for your thoughts,

    Rhett

  • #2
    RE: xBasic vs Saved Operations

    I have found the internal coding of Alpha is much faster thant xbasic. I have found running updates, appends as saved operations was the fastest in setup and execution

    Comment


    • #3
      RE: xBasic vs Saved Operations

      Jack, I tried a saved update on a table, which took 17 seconds. I then scripted it, ran it, and it also took 17 seconed. I'd be very interested to know which operations you have found to be faster, since I only tried the update.

      I can think of one advantage to running a query from a script rather than the operation. When running the script on a table from a form of that table, the resulting records are displayed. This isn't true of the op. You have to close and reopen the form to see the resulting records.

      There might be other advantages/disadvantages to one method or the other. It would be helpful to hear from other users as to what they have found.

      Comment


      • #4
        RE: xBasic vs Saved Operations

        Everyone has there own way of doing things. I script all updates that have anything other than the simplest logic involved. I find it much easier when adding, changing and sometimes deleting records from multiple tables in a single pass (fetching) through some kind of transaction table a simple task with xbasic. By documenting the script it makes it much easier to revisit the process and add to or change the logic at a later time. I keep some xbasic templates for these programs that makes the creation of a new one a simple task.

        Comment


        • #5
          RE: xBasic vs Saved Operations

          You can have your cake and eat it, too!!

          Alpha 5 has an interresting tool called the script recorder for saved operations. It gives you the option of recording "high Level" or "low Level" xbasic code from the operation. It will create script code for you.

          We have found the script code version of the operations to be a little more flexible in that thtey can be modified to accept variables passed into the script. Saved operations don't give you that option.

          The good news is that you don't need to know much xbasic. Just enough to figure out how to put your variables into the right place in the update, append, etc.

          Try it.

          Comment


          • #6
            RE: xBasic vs Saved Operations

            Hi Rhett,

            The code that a saved operation runs is, for the most part, the same as the code run in XBasic. In Alpha 5 Version 4.x, there are some oddities (minor differences in effect) between what some operations (mostly queries) apply to versus what the Xbasic does.

            In many cases, the code in a saved operation may be identical, but with the Xbasic version you can make improvements that are not possible by the saved operations. These include better filter and order expressions (the genies often create correct, but not necessarily the most efficient), elimination of redundant steps (e.g. opening and closing the same table multiple times), and features that are not available in saved operations (e.g. creating expressions that modify data during an append).

            In most cases, as Thomas suggests, use the Xbasic recorder with low level recording of the code. Then modify if slightly, adding multiple steps (several consequtive operations) and small changes as you become more familiar with it.

            When using the runtime version, I eliminate all of the saved operations (I create them mostly for testing and for generating the initial Xbasic code) so that users can not run something without it being under my applications control.

            There are also some issues people have reported when you reconfigure the table or set the operation is attached to. After the reconfigure it sometimes doesn't work and can't be modified is what I've heard. Since I don't typically do this, perhaps others can comment on this issue a bit.

            Regards,

            Ira J. Perlow
            Computer Systems Design & Associates
            csda@mediaone.net
            Regards,

            Ira J. Perlow
            Computer Systems Design


            CSDA A5 Products
            New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
            CSDA Barcode Functions

            CSDA Code Utility
            CSDA Screen Capture


            Comment


            • #7
              RE: xBasic vs Saved Operations

              One issue to watch out for when scripting saved operations:

              DON'T use table names with spaces in them. Use underscores instead.

              Disclaimer: I haven't checked this with the latest version but it was true in earlier builds of v4.

              I once tried to build an XBasic append operation for a new client that had existing tables with spaces in the names. I was not able to get it to work until I changed all his table names to eliminate the spaces. I took hours because I had to check for lookups, other scripts, etc. and modify references to the original names.

              Comment


              • #8
                RE: xBasic vs Saved Operations

                If there is still interest in this subject. While I use xbasic for the simple one to three table posting, appending, changing or deleting I have found createing new tables, importing, posting to many tables, changing groups of records, appending all records from one table to another, the saved operations takes minutes to create and run where xbasic can take upto an hour to program the same thinkg. There is no question that the saved operations run faster. I have done numerous test on this and found that the saved operations are best. Someone mentioned that they created an update and it took 17seconds using both methods. I trust if use try complex scripting you will find different results.

                Here is a good example. An insurance company has a Membership table as the parent. There are three child tables linked one to many, a dependants table, a notes table and an history table. When creating necessary reports we have to create tables where dependants that are active are billed, dependants that have dropped out of a program are credited, members that have been added are billed and those that have dropped their memberships are credited, and additional services are billed that have been rendered. Now using a complex set creates an invoice that takes 7MINUTES just to prepare and is very unstable at print time. When we used xbasic to create the necessary tables (temp) and report it took 6.5 minutes and then the printing would begin, when using saved operation it took less than ONE MINUTE. THIS HAS ME CONVINCED!

                Comment


                • #9
                  RE: xBasic vs Saved Operations

                  Hi All,

                  I have recently converted some saved operations to xbasic scripting.

                  The operation consisted of several updates and posts. It zeroed out the BALANCE field then posted payments, fees, extras etc back to the BALANCE field.

                  The saved operation could take upto 5 minutes a lot longer on older machines. The Xbasic route takes literally seconds to complete.

                  Does any one know of any downsides to this valuable time saving?

                  Michael

                  Comment


                  • #10
                    RE: xBasic vs Saved Operations

                    I meant to point out that the Script Recorder route only gives the same result as a Saved Operation route whereas the Xbasic route as below gives the enormous speed difference.

                    tbl=table.open("Practise")
                    update.fields=2
                    update.field1="parent_todate_bal"
                    update.expr1="0"
                    update.field2="last_post"
                    update.expr2="date()"
                    tbl.update()
                    tbl.close()
                    UI_MSG_BOX("User message","Done")

                    'Is this time saving secure??


                    Michael

                    Comment


                    • #11
                      RE: xBasic vs Saved Operations

                      Cal,

                      Very good point. I have a shareware utility (an add-in, actually) for Access that is really a lifesaver. In essense it's a search and replace application. You can take, using your example, the name of a table and change it throughout the entire database. This includes when found in tables, forms and the objects on them, reports, labels, letters, text, macros, code (VBA, in this case), etc.

                      It has saved my life with one Access client whose application has grown exponentially as we have progressed. There are so many reports and sub reports, as well as at least 40 tables, that I have outgrown my naming conventions two or three times. Fortunately, this utility allowed me to "upgrade" and expand my "taxonomy" as it grew.

                      I really hope someone will develop an application or add-in for Alpha Five that would do the same thing... It's currently beyond me at the moment...

                      Best Regards,

                      Geoff Hollander

                      Comment


                      • #12
                        RE: xBasic vs Saved Operations



                        one thing I would point out, that I discovered the hard way, is all things don't occur synchronously. I.e., say you have a long script that is doing a lot of different things. Say you run a saved operation, and after that, based on the results of that operation, you read and manipulate things, write records, etc., and then run another saved operation, ad infintum, you can run into trouble, since the script may keep running before the operation(s) completes.

                        I don't know personally, whether both operations and scripts run asynchronously. But I do know that I ran into problems once and have found that you can put things in a function and they will occur synchronously, since the function returns a value.

                        both global scripts and saved operations can be put in functions. since I developed this habit, I haven't had those problems.
                        i have one that updates all production indexes (logical - takes a number)
                        all I have to say is
                        production1(1)
                        another is
                        cleanup(1)
                        Cole Custom Programming - Terrell, Texas
                        972 524 8714
                        martin_w_cole@msn.com

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

                        Comment

                        Working...
                        X