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

Losing global variable value

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

    Losing global variable value

    A week or so ago in another thread I mentioned that I had experienced losing the value of a global variable. Martin Cole responded saying he also had experienced such a thing some time ago. Well, while doing heavy development work on an old app, I am now experiencing it again, pretty much on at least a daily basis. In this case the variable is the user's name and it is set in a logon script and it should be impossible for it to change until the next logon. I do see the logon user's name when I log on, so I know it is there at that point. I also occasionally notice it as I am testing the app. However, I do not notice when it goes to blank--I only notice that when I am looking at a record where it should have been written and notice that it is not there. Then I go elsewhere (e.g., the xbasic explorer) and note that it is in fact now blank.

    Has anyone besides me and Martin experienced such a thing?

    Any ideas as to how to figure out what could be happening? I am going to examine thousands of lines of xbasic code, but I can't imagine ever doing anything that would blank out this variable.

    Ray Lyons


    #2
    RE: Losing global variable value

    Raymond, I hope you figure out the issue, as I depend on global variables. And i would like to know what can destroy one.

    But a solution for you is to make it a constant. Also, if a script is trying to reset it somehwere, so long as you use an error handler script, you will get an error message when trying to reset a constant.

    t=table.open("settings")
    constant global name = t.name
    t.close()
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    [email protected]

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

    Comment


      #3
      RE: Losing global variable value

      Ray,

      I can't imagine this ever happening, and have never experienced this behavior, however, I'd look at potentially redim and deletion of variables. Array redimensioning also would be an area I would look at closely.

      Are there any eval() or eval_template() used that may have the wrong text string? How about forms with variables set to a global scope? It may also be potentially a scope setting issue, or places where you pass a pointer to the variables space.

      You could use a timer event that would check the value of the global variable and stop operations (with a dialog box, perhaps displaying the time) it if it ever became blank or similar.

      Regards,

      Ira
      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: Losing global variable value

        This has happened to me for a couple, and I think I could say, several years. I've never studied it closely, but I seem to lose mine most frequently when use the set editor. My general experience is that table editing and, once in a long while, field rule editing may also be culprits (again, nothing concrete here -- just an accumulation of general undocumented observations). But the set editor is a definite culprit for me.

        - Steve
        -Steve
        sigpic

        Comment


          #5
          RE: Losing global variable value

          Thanks Martin, Ira and Steve. Each of you has given me something to work on. I have done a bit more investigating and given what Steve said I am now very suspicious of the set editor being responsible for the loss. On this theory I had hoped that I as the a deveolper was the only one losing the value of the variable, and that is almost the case. The app was recently emptied and loaded with new records, so there are only 644 real live records to look at. Out of those only one was missing the user's name, which comes from the variable in question. That is both good and bad news. Good that it is only 1 out of 644 but bad because it really needs to be zero out of 644 because the user's are paid a significant commission on records with their name attached (thus at least one person would not be happy to hear of this problem!).

          Anyway, this is just an update. If I discover anything more of interest I'll post it here.

          Ray

          Comment


            #6
            RE: Losing global variable value

            An update: In developing, the value of the variable was bing lost any time I went into the set editor. And that was because many long years ago when the app was birthed I had for some reason made the variable global in the set editor, where of course it is ="". When I remove it from there (it was always dimmed global at logon anyweay), the value is no longer lost when using the set editor. Thanks Steve, for the clue.

            This still leaves the question as to how one time out of 644 the value of the variable did not get written to a table, but that quite possibly had nothing to do with the value being lost, though that is still possible and something I need to look into some more.

            Ray

            Comment


              #7
              RE: Losing global variable value

              Glad you found your answer. I lose the variable even though it's not defined in the set.

              As for the data error, repeat after me:

              "They're only computers - dumb computers."

              If you're concerned about a critical piece of data, I'd suggest some code in the table's "CanSave" event or similar. If a value isn't what you expect, put up a dialog to collect it and/or inform the user of the problem.

              - Steve
              -Steve
              sigpic

              Comment


                #8
                RE: Losing global variable value

                Good idea. As soon as I find a round to-it I'll do it!

                Re: "Dumb computers" I recently ran into an example of how dumb they are. Would you believe they can't see that "REFINCO" and "REFINOC" are supposed to be the same thing? Hmm, with this font they are more obviously different. Maybe that will be my excuse for taking so long to catch it.

                Ray

                Comment


                  #9
                  RE: Losing global variable value

                  Just out of curiostity, since this occurs with the set editor,
                  is it possible you have defined global variables for the set with the same name as other global variables defined elsewhere?

                  Comment


                    #10
                    RE: Losing global variable value

                    Yes. I thought I made that clear 2 or 3 posts up. In any case I should never have dimmed it in the set since it had already been dimmed gloabl in the logon script. Why I did it in the set also--well that was so many years ago there is no telling. Certainly I was dumber about this stuff back then!

                    Ray

                    Comment

                    Working...
                    X