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

Out Of Windows Memory

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

    Out Of Windows Memory

    I have a script that is about 1200 lines long (almost done) but now I keep getting an "OUT OF WINDOWS MEMORY" error generated by A5. Can something be changed to get around this error. I do not want to take the time to try and make the program shorter. It is simple code just a lot of it.

    Thanks

    #2
    RE: Out Of Windows Memory

    I took a look at the code and there may be a way to shorten the script. I have to analyze 60 pieces of data and if the IF Statement is satisfied there is about 10 pieces of data that I copy from one table to the other. This data transfer is the same in all 60 IF Statements. What feature do I use that I can define the data transfer (once) and then put that feature in the script to load all the data? Is it the FUNCTION or is there another? If Function what would be the format if the code for the data transfer would be something like the following:

    tbl.first = tbl2.firstname
    tbl.last = tbl2.lastname
    tbl.age = tbl2.age
    .
    .
    .
    tbl.married = tbl2.married

    Hope this helps

    THanks

    Comment


      #3
      RE: Out Of Windows Memory

      Philip,

      Judging by the length of what you describe I think it's save to assume you're not in the Action Scripting 'Inline Xbasic' script editor.

      You should look for discrete 'chunks' (a technical term) that could be carved out of your script and saved as a separate script. Then use scipt_play() to run the separate script at the appropriate time in your code.

      You might also look for sections which repeat with only minor variation, and put them inside a loop or other suitable program control structure. This can dramatically reduce the length of your script.

      Other code sections might be good candidates for a user defined function, which could be called with just one line of code...

      -- tom

      Comment


        #4
        RE: Out Of Windows Memory

        Tom,

        You must have been writing a reply when I put in the my second comment. If I use the play_script. Do I have to redefine the tables etc? or will it assume where I am in the current script?

        Comment


          #5
          RE: Out Of Windows Memory

          Philip, others may have different approaches, but if it were me, I'd unmark all records, step through the table one record at a time, if the record meets the criteria to be copied to the other table I'd mark it. Then I'd play a script which copies only marked records to the other table. If desired you could unmark all the records after the copy is complete, as part of the called script...

          -- tom

          Comment


            #6
            RE: Out Of Windows Memory

            Philip, if your script is running against tables that it opens itself, the called script will not be aware of them. On the other hand, if your script is running against the "current" table opened by the current form... and if your called script also runs against the 'current' table, I think (if memory serves) that the called script will actually be running against the same instance of the table as the main script...

            Comment


              #7
              RE: Out Of Windows Memory

              All of the code is being done independent of any particular form. The code will be eventually attached to a form by the name of MAINTENANCE. I changed the code to have a 2nd script to play and the tables are NOT being recognized. How do I define the tables at the beginning of the master script so that the script_plays will recognize the tables and maintain thier position within the table. Here is how the tables are currently defined. In the 2nd script the tblrsum is not being recognized.

              tblrsum = table.open("reftoavl.set")
              tblavail = table.get("availsht")
              tblvar = table.open("variables")

              Thanks

              Comment


                #8
                RE: Out Of Windows Memory

                Phillip:

                I sympathize with your situation, as I was confronted with the same dilemma just a couple months back. I, too, puzzled over why there were limits in the code buffer.

                If you search the board for "script buffer limited", you'll find a thread similar to yours.

                In your case, you'll need to find a place where you can break up the script without severing a routine in the middle. If this is not possible, you'll need to look at creating a function, if possible, to eliminate the use of excessive characters. I know Ira is particularly in tune with this.

                Keep in mind the following:

                1) It appears that it is not the number of lines, but the number of characters that are limited. This is puzzling, as Ira points out that scripts are stored in a memo file format, which would be thought unlimited. You will find that some scripts are saturated at 700 lines, some are 1200, depending on their content. Hence, removing or limiting comments, as an example, can help.

                2) I found that, in my case, it was necessary to create several consecutive scripts:

                script 01
                script 02
                script 03

                etc...

                with script_play() at the end of each script, and an 'end' after each script_play(). Be sure to close tables as you finish with them.

                3) I also needed exclusive access to files through the run of all consecutive scripts, so, after acquiring exclusive (FILE_RW_EXCLUSIVE) at the beginning of script 01, I had to 'pass off' possession to script 02, and hope I didn't lose exclusive status to the file during the pass off.

                4) Allow room for expansion, if possible. During your initial runs of the script, you may find you need to enhance the scripts. Take it from me, this is not a pleasant task when and if it comes to light, as everything must be shifted.

                I hope this helps, as I know how frustrating it can be. I am still open to other ideas on this, and would love to sit down with guys like you, Ira, or Tom, for input on other alternatives, but the bottom line is that the limits would best be removed by Alpha.

                If they can make things like expression boxes bigger solely because some users have trouble working a long expression in a tiny box, why not address this issue?

                Good luck,

                Craig

                Comment


                  #9
                  RE: Out Of Windows Memory

                  This is about the 5th script in the sequence. I am grouping individual tasks. Makes troubleshooting easier. But here I confront one script that has massive amount of code. I bragged to everyone concerned with this project that I could do the work easier with A5 than Access. Forgetting about this limitation.

                  I have searched the site and even Sylwen did not know the size limitation. But there was no clear solution other than breaking up the code. BLAH!

                  In a previous message I commented about defining a function, but don't you have to pass arguments. I don't have arguments, all I want to do is transfer data?

                  I will eventually find an answer as I have in the past but this simple task in turning into a monster.

                  Thanks

                  Comment


                    #10
                    RE: Out Of Windows Memory

                    You can easily define a function to do any repetitive task.
                    If you are copying from one table to another, you just need
                    to write a function that is

                    function philip_copy(source as p, dest as p) as l
                    dest.enter_begin()
                    dest.first=source.first
                    dest.last=source.last
                    dest.enter_end(.t.)
                    philip_copy=.t.
                    end function

                    then you can define your tables and open them in your
                    master script and just write

                    philip_copy(tbl2,tbl1)

                    whenever you need to execute all those lines of code.

                    Comment


                      #11
                      RE: Out Of Windows Memory

                      Philip, the table.open() statement has an important limitation when used to open a set. Check the xbasic ref. manual. You'll see that it will not work if any table in the set is already open... this is because table.open() assigns an alias to each table as it's opened... and the alias names for the tables in a set are not available to alpha Five if one or more is already opened. Open and close tables between scripts. Preserve your place in the table by saving pointer information to a variable and then using it to fetch_find() again when the table is reopened...

                      -- tom

                      Comment


                        #12
                        RE: Out Of Windows Memory

                        Peter,
                        Thank you very much. I just tried it and the initial indications are that you have hit the nail on the head. Just knowing the format for the function helped tremendously.

                        I appreciate the help. Now I can proceed....

                        Comment

                        Working...
                        X