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

differences between code command file and the code in a command button on a form

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

    #16
    Re: differences between code command file and the code in a command button on a form

    It can also be solved by calling u_sql2pav5f("",1,1) at the end of FIRST append operation in u_sql2pav5 function. And the SECOND append operation and the following browse in u_sql2pav5 function is deleted (moved to u_sql2pav5f).
    In this case, the command button contains only script_play_local("v_wl").

    Comment


      #17
      Re: differences between code command file and the code in a command button on a form

      I'll go a step further than Stan did. I have no idea why the use of Script_play_local() has become so popular but I see no reason to use it EXCEPT in very specific situations.

      IF script "B" is called from script "A" and script "B" needs to use a variable that was set in script "A", then one solution is to use Script_play_local(). HOWEVER, this should be a very rare occurrence for most user created scripts. It's not unheard of; just not very common.

      I can't help getting the feeling that the word "local" in this function makes people somehow feel more "comfortable" about using it. If so, you are being mislead because it could actually be more susceptible to problems if you aren't careful.

      I think the only place the use of this function might be common - and probably the reason this command was created - is in events created within Action Scripts. (This is just a guess because I don't us A/S at all.)

      The more conventional way to pass variables to another "script" is to create a function because functions are designed to have variables passed to them.

      Personally, I would recommend using Script_play() unless you know of a specific reason that Script_play_local() is needed.

      FWIW, I don't recall ever using Script_play_local() and I've been writing nothing but xbasic since somewhere in the early 90's.

      Comment


        #18
        Re: differences between code command file and the code in a command button on a form

        Hi Cal,

        Originally posted by CALocklin View Post
        I have no idea why the use of Script_play_local() has become so popular
        It is basically laziness. The local variables created in the calling script do not need to be passed with Script_Play_Local(). The entire local variable space is identical in both the calling and called scripts. But, this is a really bad thing for writing reliable code, and makes debugging much harder, as, you need to do it for all the code, rather than isolating each code piece into it's own "island of stability".

        I checked my code and found the only two reasons I use it are to call an Alpha Five built-in script (seldom needed, but the only way in certain cases of utilities, otherwise the entire code needs to be duplicated and supported) or when calling other user script code not of my making (for utilities) where I need to allow them access to certain variables I created (again for utilities). Come to think of it, it's really the same reason for both!

        Some people make everything a shared or global variable, which amounts to the same as sharing a local space, and again makes it hard to debug individual portions.

        You should always use a function with passed arguments, and possibly a WITH - END WITH region (keep it as small as possible so the as not to mix spaces for long periods), for passed variable space pointers. This is covered in my tips

        Originally posted by CALocklin View Post
        but I see no reason to use it EXCEPT in very specific situations.
        The only other exception I've seen is where Alpha forces you to do it, e.g. in older ListView object event handling for some ListView Events, and this is just the way Alpha implemented it, not the way it needed to be.

        Originally posted by CALocklin View Post
        The more conventional way to pass variables to another "script" is to create a function because functions are designed to have variables passed to them.
        And a function can be used identically to Script_Play(), and doesn't have issues (especially if a pure function). Again, see my tips.

        Originally posted by CALocklin View Post
        Personally, I would recommend using Script_play() unless you know of a specific reason that Script_play_local() is needed.
        And I'd go a step further and say Script_Play() and Script_Play_Local() are never needed for any typical code, and only slows things down, creates debugging issues, and timing issues.
        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


          #19
          Re: differences between code command file and the code in a command button on a form

          Thanks a lot for your advices and suggestions. However, after converting my sample script to a function, it still shows the same problem. The problem was solved by including the SECOND append as a called function.

          Comment


            #20
            Re: differences between code command file and the code in a command button on a form

            Ira,
            It is basically laziness.
            If you intended to use this to indicate people just have not taken the many hours to learn what is required to understand how the function script_play_local() works and the difference between that, the script_play(), and/or using a function instead, then I agree....otherwise not. :)

            I distinctly remember using script_play_local() many times in the past because I was unsure of how variables in Alpha worked (especially dimensioning)....and not knowing, the info provided about how script_play_local() will be able to use variables, made the novice (me!) use it.

            My point is that once many of the aspects of Alpha are understood, it seems many users forget the mindset of a novice and how hard it was (is) at times to grasp all the nuances of xbasic and such. I do not think laziness has all that much to do with it....being overwhelmed by the amount of knowledge it takes to understand Alpha, even on a fairly basic level, is more likely IMO.

            rant over!!
            :)
            Mike
            __________________________________________
            It is only when we forget all our learning that we begin to know.
            It's not what you look at that matters, it's what you see.
            Henry David Thoreau
            __________________________________________



            Comment


              #21
              Re: differences between code command file and the code in a command button on a form

              Hi Mike,

              I can understand many people not understanding Dimensioning, but I've seen way too many cases where other people write code and use script_play_local() and do understand the dimensioning.

              It's easier/faster than writing a function, passing parameters and isolating the code. They write the code quick and "dirty" that way, but end up never revisiting the code to do it the maintainable way. It's a technique that is not maintainable in a debuggable way as your code grows. It's like having all global variables. In Alpha Four, that was always the case, but in Alpha Five, it's not.

              But it's just like the automotive parts commercial, "You can pay me now (for the $5 part), or pay me later! (for the $1000 repair)"
              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


                #22
                Re: differences between code command file and the code in a command button on a form

                "You can pay me now (for the $5 part), or pay me later! (for the $1000 repair)"
                There are VERY few 5.00 parts and also few 1000.00 repairs anymore. LOL

                53 years in the industry here.
                Dave Mason
                [email protected]
                Skype is dave.mason46

                Comment

                Working...
                X