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 variable on initial form

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

    global variable on initial form

    I want to dimension a global variable (company name) on a main menu, shich is the start up form. The problem is that when the main menu opens up, it looks for that variable and does not find it until the form is loaded. By that time, it produces an error box which states "Warning: Field object references a non-existent field: Var->cname"

    How can I get the main menu to load and create the variable, which is stored in the start table, without the message?

    Thanks for your help.

    Regards,

    Jay Talbott
    Jay Talbott
    Lexington, KY


    #2
    RE: global variable on initial form

    Hi James

    Is this your users company or some other company name? May I suggest a setup table with its own form and then that data would always be there.

    Keith Hubert
    London.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

    Comment


      #3
      RE: global variable on initial form

      James:

      If the reason you're using a variable for the company name so that if you distribute the app, you won't have to change the menu, report headers and the like, I have a tip published in tips that you might want to see.

      It is tip 31 - go to the home page and click the 'Tips' tab and look in 'General Practices'.

      Alpha On!

      Ken

      Comment


        #4
        RE: global variable on initial form

        Just tried to look up the tip and find that tips are not loading from the main page.

        Comment


          #5
          RE: global variable on initial form

          Jay,

          The easiest way is to set up a script called "autoexec" and define and set the global variable in the script. The variable can be obtained from another table, the main menu table or just defined in the script. Since an autoexec script runs before any form is loaded, the value will exist when you main form opens.

          Jerry

          Comment


            #6
            RE: global variable on initial form

            Jerry,

            Actually, initialization of any variables or any other operation should be done with the object it is most associated with.

            If it has no association with only one object, then it should probably be put in the Autoexec script. But if it is only really associated with one form (or other layout), it should be in that form's ONINIT or possibly ONACTIVATE script. This keeps it together when you change things.

            One other thing. When creating global or shared variables, the form should have the variables also defined in it's variable list, as well as in the code.

            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


              #7
              RE: global variable on initial form

              Ira,

              You bring up something about which I have wondered for some time. How are the form variables used? I have defined several global variables for my application in the autoexec script (their contents are used throughout the program, by many different operations). From that point on, I use them in a variety of forms as well - both for mapping their contents and displaying them.

              However, I've never re-defined them in the forms themselves. Why do I want to do that? Isn't it redundant? I thought that form variables were just for those variables used... actually I'm not clear on this (you've probably already guessed that!).

              Any insights you might share would be appreciated. Thanks.

              Best regards,

              Geoff Hollander

              Comment


                #8
                RE: global variable on initial form

                Geoff,

                Unfortunately, I don't feel like I have a solid handle on them either. But here is what I think.

                The form variables basically define a variable for uses by the form where you might reference a variable and not have any code associated with it. An example is displaying a variable, or an expression editor pop-up.

                Any code has to worry about it's own dimensioning of the variables.

                If the scope of the variables (Global, Shared or Local) are different from the use in the form's variables, I would expect that to lead to trouble. Don't do it!

                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


                  #9
                  RE: global variable on initial form

                  Normally, I have found that if a variable is defined as global or shared or whatever, and then defined as a form variable with a different scope, Alpha will generate an error message when the form is edited. Sometimes finding the conflict can be a real headache.

                  Another issue comes up during editing. If variables are defined by a script, be sure to run the script before doing any editing of forms, etc. that use the variable or the object won't find the variable and will generate an error. I quess that is one reason for redefining the variable again as a form variable.

                  I use variables frequently and usually define globals in a script run by autoexec, variables used only by a form as form layout variables, and variables used by scripts as script variables. Infrequently, I use shared variables if I need to send a value between scripts or forms. Normally, I only define a variable once and set it's scope then.

                  Jerry

                  Comment


                    #10
                    RE: global variable on initial form

                    Thanks Ira,

                    It's nice to know I'm not the only one who is confused about these. Your points are well taken.

                    Thank you.

                    Best regards,

                    Geoff Hollander

                    Comment


                      #11
                      RE: global variable on initial form

                      Jerry,

                      Agreed. All good points. Thanks.

                      Regards,

                      Geoff Hollander

                      Comment


                        #12
                        RE: global variable on initial form

                        The webmaster was notified by e-mail about this issue with the tips section just 5-10 minutes ago.

                        Comment


                          #13
                          RE: global variable on initial form

                          Ira,

                          Thanks for your thoughts. My friend Barry Rochford suggested the same thing when I talked to him on the phone about this issue this afternoon, before reading the slew (slue?) of responses this question generated.

                          Thanks all for your help.

                          Regards,

                          Jay Talbott
                          Jay Talbott
                          Lexington, KY

                          Comment


                            #14
                            RE: global variable on initial form

                            Just to add a little here, if you do distribute your application you can use a parameter table to hold company details such as name etc.. and fill the global variables from this table from within the autoexec script.

                            Ron

                            Comment


                              #15
                              RE: global variable on initial form

                              Ron,

                              Exactly the method I use to fill many global variable values. It makes the app much more portable. Using this method, you don't need to hard code report titles, form titles, etc, just use global variables. Just fill in the company table for the specific company, and all values will be correct. You can also use this if the user has more than one configuration or location for the company. Each configuration can have unique values.

                              Jerry

                              Comment

                              Working...
                              X