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

Am I doing something wrong with Functions()?

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

    Am I doing something wrong with Functions()?

    Greetings,

    As I am getting into writing functions I have run into something that is a PITA to be sure !!

    Everytime I modify my code (for a function), I have to close the database and reopen it to be able to test the changes. Is this normal, i.e. the way A5 is suppose to work? Do I have a default setting incorrect? Just because I edit and save the function, isn't there a way to tell A5 to either re-read it, something other than closing and reopening the database...it is a real waste of time !!

    Regards,
    Keith
    Keith Weatherhead
    Discus Data, Ltd
    [email protected]

    #2
    Re: Am I doing something wrong with Functions()?

    As long as you save your function changes, it should be immediately available. It is for me.
    Peter
    AlphaBase Solutions, LLC

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


    Comment


      #3
      Re: Am I doing something wrong with Functions()?

      Originally posted by Peter.Greulich
      As long as you save your function changes, it should be immediately available. It is for me.

      I get either the previous version, without the changes or it simply DOES NOT work at all. I am using V7 4076-3031.

      Is there some sort of Preference setting that effects functions?

      Keith
      Keith Weatherhead
      Discus Data, Ltd
      [email protected]

      Comment


        #4
        Re: Am I doing something wrong with Functions()?

        Hi Keith,

        You should not have to do anything except save the function (and have no compile errors) in order to use it. Trust me, I do this what seems like 24/7!

        However, there are things that people (meaning anybody programming) that can cause problems. E.g. Opening a file or table in exclusive mode without closing it. Or setting global variables that are assumed to be cleared (which they are after a restart of A5, but may not be after running code of yours)

        Or using a DECLARESTRUCT in some code that is executed and then changed requires restarting Alpha 5.

        But in general, if you clean up after youself, it should run every single time correctly.

        If you want to restart A5 very quickly, see my ScriptEditRestore entry in the code archive here. That takes only a couple of seconds to exit and restart A5, and restore your code editing windows.

        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


          #5
          Re: Am I doing something wrong with Functions()?

          Originally posted by KeithW
          I am using V7 4076-3031.

          Is there some sort of Preference setting that effects functions?
          1. Same version here.

          2. Not that I ever heard of.
          Peter
          AlphaBase Solutions, LLC

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


          Comment


            #6
            Re: Am I doing something wrong with Functions()?

            I don't have to close A5, just the current database and then reopen it.
            The trouble is that closes all of the code windows and things that you have positioned, so you have to reset your work area.

            I do open and close a file so I would think that is not the issue as the file is getting created properly.

            I am not doing the other thing that Ira listed so I'm not surem but know it is a real PITA !!

            Keith
            Keith Weatherhead
            Discus Data, Ltd
            [email protected]

            Comment


              #7
              Re: Am I doing something wrong with Functions()?

              Originally posted by csda1
              Hi Keith,

              (text deleted)

              But in general, if you clean up after youself, it should run every single time correctly.

              If you want to restart A5 very quickly, see my ScriptEditRestore entry in the code archive here. That takes only a couple of seconds to exit and restart A5, and restore your code editing windows.

              Hi Ira,

              I just grabbed a copy of your ScriptEditRestore, after shooting myself in the foot, a time or two, I think I have it figured out, from a usage standpoint. It works nicely and is certainly much easier than manually doing those same tasks. A couple of additional questions...

              1. Is it possible to close and reopen the database, without dropping A5 itself?

              2. Is there a way to also handle things like the forms and other layouts, besides the Code window?

              Otherwise, it is a neat utility function and it will definately help, however I need to find out why changes are not made available immediately when I'm editing functions... I still have to have another problem that has yet to be handled.

              Thanx,
              Keith
              Keith Weatherhead
              Discus Data, Ltd
              [email protected]

              Comment


                #8
                Re: Am I doing something wrong with Functions()?

                Hi Keith,

                Yes, it is possible to exit the database and restore the windows, I'll add that feature for a future revision.

                The current script may have some issues with grabbing the last scripts being edited when you exit, but always works if you use the ___ script.

                Saving all the forms and other such things is a bit more complicated but might be possible, especially for layouts in the design mode. I'll consider it, but it's not high on the list as this is not providing any revenue for me.

                Also, another problem you may be having is Aliases for various objects, ala, if you open form "Invoice", the 1st use is "Invoice". If you don't close it or reuse it, the 2nd use is "Invoice0", 3rd use is "Invoice1" etc. If you reference "Invoice" it may not exist. You need the correct reference to the Alias, not the name of the form, or the pointer. That's why using pointers to objects are much better. I suggest you post an example piece of code, and we can better explain why you are having problems.
                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


                  #9
                  Re: Am I doing something wrong with Functions()?

                  Originally posted by csda1
                  Hi Keith,

                  Yes, it is possible to exit the database and restore the windows, I'll add that feature for a future revision.

                  The current script may have some issues with grabbing the last scripts being edited when you exit, but always works if you use the ___ script.

                  Saving all the forms and other such things is a bit more complicated but might be possible, especially for layouts in the design mode. I'll consider it, but it's not high on the list as this is not providing any revenue for me.

                  Also, another problem you may be having is Aliases for various objects, ala, if you open form "Invoice", the 1st use is "Invoice". If you don't close it or reuse it, the 2nd use is "Invoice0", 3rd use is "Invoice1" etc. If you reference "Invoice" it may not exist. You need the correct reference to the Alias, not the name of the form, or the pointer. That's why using pointers to objects are much better. I suggest you post an example piece of code, and we can better explain why you are having problems.

                  New feature, cool... let me know when you get there..

                  The biggest problem was I renamed the script, put an "_" in front of it to put it up by the top with the "___" before I really looked at the code. After renaming it, I deleted "__" and then couldn't remember how it got initially created. Once that was fixed, it has worked fine.

                  The other objects was just a question. It is not what is involved with what I am doing at the moment, was wondering if it could be made to provide a "total development desktop" preserve and restore. Understand the "what generates revenue" issue.

                  Lastly, "I can't", it is code that is part of a commercial product's License Manager, the rest should be easily understood.

                  Thanx,
                  Keith
                  Keith Weatherhead
                  Discus Data, Ltd
                  [email protected]

                  Comment


                    #10
                    Re: Am I doing something wrong with Functions()?

                    An old thread but I was having the same issue as Keith, i.e. After editing a function the changes wouldn't take effect unless Alpha was restarted.

                    Turned out I had started the function with Visual Basic like syntax

                    Code:
                    FUNCTION searchTable() as V
                    xxxxxx
                    END FUNCTION
                    instead of xbasic's

                    Code:
                    FUNCTION searchTable as V ()
                    xxxxxx
                    END FUNCTION

                    Dumb mistake but perhaps its something check syntax could have picked up.


                    Chris

                    Comment

                    Working...
                    X