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

Global variables using

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

    Global variables using

    Hi all.

    I am little confused about using global variables.
    I declared some of them in Autoexec script, like:

    DIM GLOBAL pFIRREC AS N
    DIM GLOBAL pFIRNAME AS C

    As manuals says we can view all of them in whole application, from the moment database is open up to time we close that database.

    1. But, I was in position that when I click on big V in toolbar (when some form is in design mode) I can,t see any of them. I can only define new one.

    2. Where can I allways se all of them when designing apllication ?

    3. A can,t use them in Default expression in Field rules, etc.

    4. Also I can,t use them as arguments in INSERT statement in Active link table (I wanted to place global variable pFIRREC instead argument :new.FIRREC in INSERT statement), but it not succeded.

    5. Also, in some thread one expirenced user stated that he defined same global variable for two tables, parent and child table. That also confused me. I thought that once declared global variable is valid and visible in all parts of application and is same for all applicatin objects !?

    Can anyone explain what can I expect from global variables ?

    Thanks,

    Dordije.

    #2
    Re: Global variables using

    1. But, I was in position that when I click on big V in toolbar (when some form is in design mode) I can,t see any of them. I can only define new one.
    The heading for the dialog that appears when you "clck on big V says Define New Variables, not See All Variables.

    2. Where can I allways se all of them when designing apllication ?
    You should be able to see them in the drag-drop list when designing a form.

    3. A can,t use them in Default expression in Field rules, etc.
    You should be able to type in the variable's name even if you can't see it.

    4. Also I can,t use them as arguments in INSERT statement in Active link table (I wanted to place global variable pFIRREC instead argument :new.FIRREC in INSERT statement), but it not succeded.
    No experience with Active link tables.

    5. Also, in some thread one expirenced user stated that he defined same global variable for two tables, parent and child table. That also confused me. I thought that once declared global variable is valid and visible in all parts of application and is same for all applicatin objects !?
    Not familiar with that thread. Why are you worried about it? You can define a global variable, a session variable, and a local variable with the same name. He/she may have had some reason to ensure that the two tables referenced the golbal entity.
    There can be only one.

    Comment


      #3
      Re: Global variables using

      Thanks Stan !

      Add 3.
      You should be able to type in the variable's name even if you can't see it.

      What confuses me in this point is that in simple default expression bulder I can,t in no way see needed global variabe (not with F2,F3 etc), expect that I know its name. In A5 help I can see that I can use F6 Variable, but on my A5 V9 Platinum with update from march I can,t see this F6 ?

      But when I pressed F6 I got dialog for geting global variable. Selected global variable is declared as N, but when I click OK I get message "Expression does not evaluate to a Numeric value" ? Both the database field and global variable are numeric !? Why this message ?

      Thanks.

      Dordije.

      Comment


        #4
        Re: Global variables using

        Add 3.

        I succeded in Default expression for Field rules, using F6, to put expression VAR->pFIRREC, where pFIRREC is global variable.

        In expression builder I can see that it is type N and value is 2.
        When I click on OK and then click Save I got message "Cannot use function in this context". What is wrong in my expression ?

        Thanks,

        Dordije.

        Comment


          #5
          Re: Global variables using

          Dordije. ,

          I got message "Cannot use function in this context". What is wrong in my expression ?
          Hard to say (or even imagine!) without knowing what your expression is or the function you have used that cannot be used.
          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


            #6
            Re: Global variables using

            Add 3.

            I deleted field rule. Anyway, when testing, in trace window A5 still warns me about errors in evaluating field rule ? I don't have any one !

            Also, in A5 help, I can't find correct syntax for FORM.VIEW() method. In help I can't see explanation for sixth parameter, for arguments. Anyway, on the base on threads I use syntax:

            FORM.view("frmARTICLES","","","","",mArgs)

            My A5 V9 Platinum Version Build is 2095 and System Addin Build is 3264. Does anybody have some newer versions ?

            I have downloaded last update. Are they cummulative ? Must I download any previous update in same version, or last update include previous one ?

            Are thera are any ghosts on my A5 :)) ?

            Thanks,

            Dordije.

            Comment


              #7
              Re: Global variables using

              HI MikeC !

              In expression builder I hit F6 and selected global variable pFIRREC. Builder puts VAR->pFIRREC, and say it has value 2 and is Numeric (both are true). Then, I click OK. Nothin happened, seems all is ok. Now I am on Field rules window, tab Data Entry, with next content:

              Default mode: Simple default expression
              Default value: VAR->pFIRREC

              Then I click Save and got message "Cannot use function in this context" !

              Dordije.

              Comment


                #8
                Re: Global variables using

                Dordije.,
                You have to make certain that you have dimmed your variable as global in the autoexec (or wherever you declare it). I was able to reproduce your error message with it not declared global. Make sure you have done this as it works here with the same latest builds as you have.
                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


                  #9
                  Re: Global variables using

                  Hi MikeC,

                  I surely dimmed variables as global, in Autoexec, as:

                  DIM GLOBAL pFIRREC AS N

                  Later, in some of begining forms I initialized it on value 2.
                  Also, when I in Expresion builder hit F6, and select global type variables, I can see all of them I declared as global in Autoexec script.

                  Thank you MikeC, I must investigate this further.

                  Dordije.

                  Comment


                    #10
                    Re: Global variables using

                    Dordije. ,

                    As it works here just fine something else is the issue....but, to me, having the Exact same error come up when the variable is NOT dimmed Global and works fine once dimmed global sure is a big coincidence!! But, please report back if the reason behind this surfaces as it is nice to know of other ways in which the same error message will come up if that is the case.

                    I would approach this from "square one". Make another form with just the minimum. Dim your global variable for this form in the same way as you did for the form's field in question. Set your field rules. If it still happens then submit it here for others to help.

                    .....without having the same issue as you the only way I could help further would be with a sample that has the same problem.

                    LATER: I just read a different post that referred back to this one and found
                    you cannot use a global variable in the default value field rule. (you can for a normal dbf table but not an active link table.
                    And that it very well could be a bug...Here is a link to the thread. http://msgboard.alphasoftware.com/al...ad.php?t=80085
                    Last edited by MikeC; 06-25-2009, 09:42 AM.
                    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


                      #11
                      Re: Global variables using

                      Hi Mike,

                      I replied on thread you pointed me to. It appears that it is not possible to use a global variable as the default value in field rule, with Active link tables.

                      However, I will try to make some simple form and do what you proposed. I will dim global variable for that form and will se what will happen.

                      Thanks,

                      Dordije.

                      Comment


                        #12
                        Re: Global variables using

                        Hi Mike,

                        Meanwhile I made a few new tests with other simple forms. After examining all what happend with global variables and field rules it appears that next is valid (thanks to Tim):

                        1. When using Active linked tables, we cannot use global variables as default value. For me, main indication is that in Expression builder we do not have listed F6 key (Variables), we can only see F2,F3,F4 and F9. But, no matter we can't see F6 we can press F6 and select global variable, but I thing this is supposed not to be used.

                        2. We define Field rules on table fields, in Table/Sets tab. I use Active linked tables. When using .DBF tables, I can define that default value for some field is global variable. Interestingly also with .DBF tables I cannot see F6 key in Expression builder, but I can press it. Design of forms do not influence in any way on definng Field rules ant its default values.

                        Dordije.

                        Comment

                        Working...
                        X