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

Short on inline script space

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

    Short on inline script space

    Hi,
    I have 2 problems
    1.
    I have a form where on entry and upon several button pushes
    a script (inline) is run which among other things hides and shows certain items on the form.

    The problem is that I have run out of space for several of them so I am trying to find a way of cutting down the scripting either by being able to do multiple hides or shows on 1 line or to try and put 'parentform' as a variable so it doesnot have to be typed each time in full only say 'PF' so as to give me the space I need.

    Enclosed is a sample of one of the scripts to explain.
    Any ideas would be most helpful.
    this.disable()
    response=ui_msg_box("Question","Save Current Customer?",35)
    If response=6 Then
    If isnotblank("company") then
    parent.commit()
    else
    cancel()
    end if
    Elseif response=7 Then
    cancel()
    Elseif response=2 Then
    goto out
    End If
    parentform:Text37.show()
    parentform:Frame19.show()
    parentform:Button25.show()
    parentform:Button26.show()
    parentform:Button27.show()
    parentform:Button28.show()
    parentform:Button3.show()
    parentform:Search_For.show()
    parentform:Search_By.show()
    parentform:Search_By_Lbl.show()
    parentform:List_Company.show()
    parentform:List_Name.show()
    parentform:Browse_Label.show()
    parentform:Button6.show()
    parentform:Button1.hide()
    parentform:Button2.show()
    parentform:Button4.hide()
    parentform:Button26.activate()
    parentform:Button5.hide()
    parentform:Button7.show()
    parentform:Text13.text="EDITING CUSTOMER"
    parentform:Text13.refresh()
    this.enable()
    End
    out:
    this.enable()
    2.
    what would the script be to delete and then pack a record on a button and would this delete the 1-many (cascaded changes) records linked to it also (which I want it to).

    Again thanks for your help

    Mike

    #2
    RE: Short on inline script space

    Mike, lengthy scripts can be broken down into smaller ones. Those can be saved under separate script names. Then each can be called when needed using script_play()

    You're bumping into a limit on the number of characters which can be stored in an inline script, I would imagine.

    Using script_play() the inline script can become quite short.

    Another alternative, of course, is to convert your action scripting code to Xbasic. You will have much more room for a long continuous script. But even there, eventually, you will run out of room. So it's good to be familiar with script_play().

    -- tom

    Comment


      #3
      RE: Short on inline script space

      Tom,

      I've never run out of room on xbasic code (not inline code). I can't believe there is any limit. Do you have any idea what the scope of this is?

      Even if there is a limit, If you are hitting it, I'd suggest a radical rethinking of your coding method. Good programming practice tends to say that ideally, any code fits ideally on 1 sheet of paper. If it needs more, it probably needs to be broken up into smaller pieces (ala functions, either embedded or global).

      I believe my longest piece of code was several hundred lines (alot of field mapping), but I simplified it immensly by using loops that automatically generated the mappings. On the other hand, I could have placed all of the mappings in a separate module.

      For what it's worth!

      Regards,

      Ira J. Perlow
      Computer Systems Design & Associates
      [email protected]
      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


        #4
        RE: Short on inline script space

        Ira, your comments are worth a lot!

        I hit the limit at about 1,000 lines. Others have said that it's not a line limit, but a cumulative character count limit, I don't know for certain. But it's true... there is a limit. (I was using vers. 4.03 at the time, but don't know if that's significant.)


        And, if my earlier post in this thread suggests that I think folks should intentionally build lengthy scripts, let me hasten to correct that misconception.


        I agree with you. It's poor practice to be sure. When I hit the 'wall', I was working on what started out as a small project. (Ever heard that one, before?) It grew and grew and grew. I took the lazy way out when encountering the need to evaluate a lengthy series of conditions, and repeated entire blocks of code over and over, with minor variations. That's when I hit the limit. The facility with which Windows lets one copy and paste, and paste, and paste, and paste... did me in.

        With only a little thinking I was able to consolidate entire 'chunks' (a technical term, roughly equivalent to a module) into manageable blocks. A happy byproduct was that the code is now much, much easier to maintain.

        I've read that a good size limit is the amount of code that can fit on one page. This also corresponds (roughly) to the amount I can now comprehend at any one time, so I'm using it as a guideline on newer scripting projects.

        And, when I find myself beginning the process of pasting a series of repetitive code segments I make myself stop and re-examine the design.

        -- tom

        Comment


          #5
          RE: Short on inline script space

          Hi Guys,

          I have a lot of forms, with many buttons, each with inline XBasic scrips for routines such as choosing a field from the working table, testing it for length, type, and decimal, then loading that info up to a bunch of global memory variables, etc. I have run out of space right away in most of them and have NEVER gotton 1,000 lines out of one.

          Tom's speculation regarding a character (or perhaps line) count makes sense to me because I modify my code a lot. To wit, I have lots of empty lines separating sections of my scripts so that editing is faster and the patterns more visually obvious to me once I have a good script written.

          Tom's suggestion of using several smaller scripts is a good one, and I have found that by setting up a series of scripts, in order of their excecution, works really well. The only thing that's required is not to put "END" at he end of any of the separate scripts except the final one in the series.

          I sort of like this because it keeps all the pertinent scripts together in the form/control's "area".

          Anywho,

          Via con Bios

          Geoff Hollander

          Comment


            #6
            RE: Short on inline script space

            Geoff:

            That's 'Via con cmos' -- where the he__ di you learn Spanish.

            Ken

            Comment


              #7
              RE: Short on inline script space

              Geoff, Ira and I were discussing Xbasic Code scripts, written outside of the Action Scripting Editor. Your description sounds like you have hit the shorter limit which is present when you insert a command statement using 'inline xbasic' within the Action Scripting Editor.

              -- tom

              Comment


                #8
                RE: Short on inline script space

                Hi,

                Right, and right again.

                Geoff

                Comment


                  #9
                  RE: Short on inline script space

                  Whatever the limit is, the company has announced that it will be increased in Version 5.

                  Bill
                  Bill Hanigsberg

                  Comment


                    #10
                    RE: Short on inline script space

                    To All:

                    It is my understanding that it will not be increased in Version 5.

                    Instead, SCRIPT_PLAY_LOCAL() will be introduced. It will allow open tables to remain accessible throughout the string of linked scripts. In a sense, script 01 - script 05 will play as one long script without having to close and reopen tables at the end and beginning of every script.

                    I consider this an exceptable solution, resolving the release of FILE_RW_EXCLUSIVE between scripts...

                    Craig

                    Comment


                      #11
                      RE: Short on inline script space

                      Geoffrey:

                      If all is working, then you are probably OK, but I have found that it is best to put an end statement on each script.

                      If you are running five scripts with SCRIPT_PLAY(), the latter scripts are cascading within the original scripts:

                      SCRIPT 01 -> SCRIPT_PLAY 02
                      SCRIPT 02 -> SCRIPT_PLAY 03
                      SCRIPT 03 -> SCRIPT_PLAY 04
                      SCRIPT 04 -> SCRIPT_PLAY 05
                      SCRIPT 05 -> finish SCRIPT 05
                      finish SCRIPT 04
                      finish SCRIPT 03
                      finish SCRIPT02
                      finish SCRIPT 01

                      If there are no statements after SCRIPT_PLAY() in SCRIPT 01 - SCRIPT 04, your probably OK, but technically, those scripts are still running...

                      What problems did you encounter when you put the end statement in all the scripts after the SCRIPT_PLAY() statements???

                      I have had none.

                      Just Curious,

                      Craig

                      Comment


                        #12
                        RE: Short on inline script space

                        Hi Craig,

                        I may have been thinking of the script buffer for the xbasic editor rather than inline xbasic. I look in the V5 document but was unable to locate a discussion of this.

                        Perhaps it was mentioned at the conference.

                        Bill
                        Bill Hanigsberg

                        Comment


                          #13
                          RE: Short on inline script space




                          Bill:
                          Version 4.5 has two "bug fixes". I bet this is what you were
                          talking about...

                          Action Scripting � Inline
                          Xbasic

                          Inline Xbasic in Action Scripting is limited to 1,024
                          characters. Previously Alpha Five did not put up an error message when you
                          reached this limit. Now it does. If you need to create a longer inline Xbasic
                          script, simply use multiple Inline Xbasic actions.

                          Script Buffer

                          The size of the script buffer has been increased.
                          Previously if you had a very long script, Alpha Five would hang when you loaded
                          the script. The script buffer has now been substantially increased.

                          The new error message (I just tested it out...curiousity!)
                          yields the familiar "Out of Windows
                          memory!" dialog box, the exact same one that appears with a global
                          script. I take it Mike Lyon is using a version prior 4.5.
                          I never use inline basic for much, I usually
                          convert to XBasic if need be...
                          Take Care!
                          Craig

                          Comment


                            #14
                            RE: Short on inline script space

                            That's it.

                            I don't use inline xbasic either but then I've never exceeded the script buffer...yet.

                            Regards,
                            Bill
                            Bill Hanigsberg

                            Comment


                              #15
                              RE: Short on inline script space

                              thanks for the many replies,

                              In answer to one question I am using the latest V4.5 Build266
                              I do try and keep my scripting structured and as small as possible but as you can see from the above sample what I am trying to do is far from easy to shorten. I did have a solution of making the lines shorter by using parentform as a variable ie pf so as to free up char space but as no one has commented on this I take it as a non starter.

                              I will try it with script_play() method as suggested by Tom (thanks again buddy) although I feel this will give me all new and improved problems(as always) so I may be back to haunt you guys.

                              Finally did anyone notice my 2nd problem as this I am sure is easier to solve (You guys always pick the hard ones).
                              To recap - what would the script be to delete and then pack a record (on a button) and would this delete the 1-many (cascaded changes) records linked to it also (which I want it to).

                              Thanks again guys for your continued support.

                              Mike

                              Comment

                              Working...
                              X