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

Ira, Finnian, Bill H, et al

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

    Ira, Finnian, Bill H, et al

    I will try tomorrow to write my first function. So far I have been using script_play("xxx") - but I am having this problem:

    at the "save" button - i may say
    parentform.commit()
    script_play("scriptone") 'manipulate some files
    script_play("scripttwo") ' read files and update the balance due
    formview("nextform")
    parentform.close()

    but apparently things are not happening in that order, synchronously, and it is wreaking havoc.


    if i put scriptone and scripttwo in functions, would things then occur in order?

    currently the only way i can get things to work is to say:

    parentform.commit()
    parentform.close() 'THIS IS SUPPOSED TO BE ILLEGAL
    script_play("scriptone") 'manipulate some files
    formview("nextform")
    ---at the onactivate event of "nextform", check for a globalvariable, and if true
    ---script_play("scripttwo") ' read files and update the balance due
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    [email protected]

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

    #2
    RE: Ira, Finnian, Bill H, et al

    I, too, am interested in this topic - having encountered difficulities which seem to be related to the sequence in which scripts run. Are there any design guidelines available on this?

    It seems that code which simply manipulates memory or opens and closes forms runs consecutively, one statement at a time. However, if the script includes code which manipulates tables (and by necessity their indexes), later statements in the script often seem to execute before the table processing is completed.

    What's the best way to assure that the table processing has been finished, before the next code sequence in the script begins?

    Comment


      #3
      RE: Ira, Finnian, Bill H, et al

      Tom,

      From Bill in an earlier post.

      "One approach would be to test for exclusive access before running your operation. If the test fails (meaning the table is in use by another process) you could put a timer delay on your process and have it try again. Perhaps give it 3 tries before it aborts."

      Stan
      There can be only one.

      Comment


        #4
        RE: Ira, Finnian, Bill H, et al

        like have a global variable "busy" - L
        scriptone sets busy to true at start and false at end
        scripttwo has if .not. busy ... else loop x times
        etc.

        ??
        Cole Custom Programming - Terrell, Texas
        972 524 8714
        [email protected]

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

        Comment


          #5
          RE: Ira, Finnian, Bill H, et al

          >>It seems that code which simply manipulates memory or opens and closes forms runs consecutively, one statement at a time. However, if the script includes code which manipulates tables (and by necessity their indexes), later statements in the script often seem to execute before the table processing is completed.
          Peter
          AlphaBase Solutions, LLC

          [email protected]
          https://www.alphabasesolutions.com


          Comment


            #6
            RE: Ira, Finnian, Bill H, et al

            i am having various degress of success by the following:

            var->cnum (customer number) is my application wide linking field, and most of my scripts, operations, etc. are based just on the var->cnum

            i have made two functions
            fixone as L(cnmbr as n)
            this follows Peter Wayne's statement that a function must return something

            so i say fixone(var->cnum)
            then, virtually the same code in my script is in the body of the function
            then i have another called uponebalance
            in some situations i can say
            fixone(cnum)
            uponebalance(cnum)
            and they seem to fire synchronously - not interfering with each other - but in other places the form freezes - further research underway

            but i wish one of the top dogs would advise as regards this
            Cole Custom Programming - Terrell, Texas
            972 524 8714
            [email protected]

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

            Comment


              #7
              RE: Ira, Finnian, Bill H, et al

              Multithreading.
              There can be only one.

              Comment


                #8
                RE: Ira, Finnian, Bill H, et al

                But not intelligent multithreading as I see it, especially when you can zap a table and have a command to append to the same table and the append will begin before the zap is finished.
                There can be only one.

                Comment


                  #9
                  RE: Ira, Finnian, Bill H, et al

                  Hi Martin:

                  I'd like to be able to offer some sage advice but, in the present circumstances, I'm too swamped to address the question much more than the following:

                  In general the functions I use are pretty straightforward either to return a value or produce a pick list and, strictly speaking that's just as well done with a script_play.

                  I've never had to use successive script_play commands (though I do frequently use conditional script_play commands) to get something to run, so I've not had the syncronicity problem you refer to, at least not since V1.

                  Finian
                  Finian

                  Comment


                    #10
                    RE: Ira, Finnian, Bill H, et al

                    OK, you've got me curious.

                    I have a number of scripts that do things like this. One of them creates a new table (or copies to a new table?), sets up two relationships (child and grand-child), copies to another new table, posts some data from another table, then appends the result to the table that contains the desired report format.

                    I have never had any problem with this script or other similar ones that I use. All these scripts are either individual scripts on a button or, in most cases, the button will simply have a 'script_play()' command which activates a single global script. (I prefer to use global scripts because I can save development time by leaving the form open while editing scripts.) All my copy, post, append, etc. routines are also coded in Xbasic; I do not call saved routines.

                    My question is: Are people seeing this problem when everything is in one Xbasic script or is this something that happens when one script calls 2 or more 'script_play' commands within it. Or, is it perhaps when using in-line Xbasic in action scripts or when calling saved routines?

                    Comment


                      #11
                      RE: Ira, Finnian, Bill H, et al

                      Martin,
                      This may not relate to what you are doing, but one of the things I do a lot of is run chains of scripts. A button on a form runs "scripta", and "scripta" runs "scriptb". I have had timing issues in other areas, but never with chaining scripts together.

                      Did you try putting a one or 2 second pause between the two scripts that you were originally trying to run back to back?

                      Good luck,
                      John

                      Comment


                        #12
                        RE: Ira, Finnian, Bill H, et al

                        Cal,

                        My problem arises when using an inline xbasic "step" to run a script which contains multiple commands. If the table being manipulated is large enough, and you first want to empty the table, then append to it, the append will begin before the zap is finished.

                        Be glad to provide more detail and code if you desire.

                        Stan
                        There can be only one.

                        Comment


                          #13
                          RE: Ira, Finnian, Bill H, et al

                          Thanks, that's what I wanted to know.

                          You might be interested to know that I missed a step in me previous description. Before I append the data to the report table, if first Zap it. So, my guess is that everything would run fine if you convert the whole thing to one Xbasic script. I can't guarantee this because the way I build the tables the only data in the report table is the data used for the previous report - it isn't huge but I just ran it with 13,000 records and had no trouble.

                          Cal

                          Comment


                            #14
                            RE: Ira, Finnian, Bill H, et al

                            I'm flattered but I am no top dog even though I am starting to know where to find some of the hydrants.

                            Anyway, here is something to try. What if we were to:

                            open the table (rw_exclusive)
                            zap the table
                            Close the table

                            reopen the table
                            do whatever else we need to do
                            close the table

                            I *hope* that the close wouldn't execute before the zap is complete and the reopen wouldn't happen until the close had executed.

                            I have some recollection of seeing code organized in this fashion and wondering why someone would want to close a table only to reopen it. Perhaps this is the reason.

                            I'd be real interested in peoples' experiences.

                            Bill
                            Bill Hanigsberg

                            Comment


                              #15
                              RE: Ira, Finnian, Bill H, et al

                              Bill,

                              I can't tell you what effect it would have but I can tell you why I sometimes close a table just to re-open it a few lines later.

                              1. I wasn't thinking far enough ahead when I closed it the first time.
                              2. It is good practice to always close files and tables before ending a script and I find it easier to open and close them at each step. (ie, open the file, copy the data, close the file.) Usually there will be a few lines with something like a message box, traceln, hourglass_cursor, etc., ... or, at the very least, some comment lines telling what's happening between each step. These act as a good divider between 'steps' when I review the script for Open()/Close() combinations at a later date. Yes, theoretically it takes a bit more time for the script to run but it's insignificant compared to the amount of time it takes to run something like a copy routine. Also, it's insignificant compared to the time I waste trying to figure out where I opened each file and whether or not it has been closed. This also makes it easier if I change the script to either delete one of the steps or add something else in between.

                              The bottom line, I do it for my convenience; not to make the program run better.

                              Of course, that's only my opinion. Maybe someone else has found another reason. Anyone...?

                              Comment

                              Working...
                              X