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

A new variable scope

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

    Re: A new variable scope

    Originally posted by G Gabriel View Post
    You do not need to load the script in order to save the new one.
    Gabe:
    Let me repeat in case you missed it:
    If you want to operate in a 1 person, 1 thread operation go ahead, you'll run just fine.

    But you can't do any Multi-user, multi-thread, or Multi-process operation properly (meaning without errors) without a proper read-modify-write (Test & Set) in a single indivisible (atomic) operation as it's basis.

    When you join the real world that does more than single threaded operations, you'll find that over 60 years of modern age computers are based on and work because of locking mechanisms.
    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


      Re: A new variable scope

      Ira,

      So if you'd like to dynamically mess with your data dictionaries, the functions include
      A5.WRITE_SETTING( Setting_Name as C, Value as C )
      A5.READ_SETTING( Setting_Name as C )
      and it's big brother versions
      A5_LOAD_SETTINGS( Setting_Name as C, Dot_Variable as P [, Dictionary_Name as C ] )
      A5_SAVE_SETTINGS( Setting_Name as C, Dot_Variable as P [, Dictionary as C ] )
      A5_DELETE_SETTINGS( Setting_Name as C [, Dictionary as C ])
      If you'd like to mess up your Windows registry, we also have these functions (although at least these are only available to a single user)
      REGISTRY.LOAD_SETTINGS( Registry_Key as C, Dot_Variable as P )
      REGISTRY.SAVE_SETTINGS( Registry_Key as C, Dot_Variable as C )
      REGISTRY.DROP_SETTINGS( Registry_Key as C )
      But if you really want to just waste more time, and slow things down, then use
      SCRIPT_LOAD( Script_Name as C [, Password as C ] )
      SCRIPT_SAVE(C script_name,C script_code[,C Password])
      If I save something to my registry, can another computer share it? If I save something in a script or any data dictionary on my computer, can another computer share it? If I have a variable on my computer it the Alpha memory range, can another computer share it? NO

      I believe these would work on a single user system, but that is not what I mean at all. I mean a shared by anyone connected by a shadow to a server would also be able to share a memory space on that server for the use of a variable(maybe more). Without the use of that memory space, then we are relegated to the use of a table since it is the data that goes back and forth.

      Maybe if we ever get to a real server system with a direct connection, we can do that. I am sure Alpha has been working on that, but do not know where it stands in the priorities. Suspect the web stuff comes first.

      Now, if we all used the webserver, rewrote our apps, and connected by way of intranet, we could do what g thinks in a way. Am I right?

      As it stands now, I(as many do) load all company information into vars for quick use wherever needed, but it is all on the user's computer. There are are other vars that get changed repeatedly on the users computer. I cannot dim a var that is universal and changeable by all the computers in a days work, it has to be saved in a table or I have to make another way to the server. Come to think about it, that is possible, but is it worth the traffic that could come from it and it still has to be written to a file.

      DaveM
      Dave Mason
      [email protected]
      Skype is dave.mason46

      Comment


        Re: A new variable scope

        Ira,

        I don't know if you've unblocked Gabe so you are able to see his comments. If not, you should consider unblocking him. It would lower the frustration levels for both of you.

        kenn
        TYVM :) kenn

        Knowing what you can achieve will not become reality until you imagine and explore.

        Comment


          Re: A new variable scope

          Originally posted by DaveM View Post
          If I save something to my registry, can another computer share it? If I save something in a script or any data dictionary on my computer, can another computer share it? If I have a variable on my computer it the Alpha memory range, can another computer share it? NO
          Absolutely correct.

          Originally posted by DaveM View Post
          I believe these would work on a single user system, but that is not what I mean at all. I mean a shared by anyone connected by a shadow to a server would also be able to share a memory space on that server for the use of a variable(maybe more). Without the use of that memory space, then we are relegated to the use of a table since it is the data that goes back and forth.
          I'm not sure how to interpret what you said above.

          Any data stored in a file in any format in a shared network location (this could mean as a text file, non-shadowed (Master) data dictionary, shared table, whatever), can be used 100% safely by any other user if, and only if, there is
          • a locking mechanism (and is used properly) that provides a Read-Modify-Write operation without interruption from any process, and the use of it is done correctly, or
          • You have a server that arbitrates request for the shared resources and decides which processes data gets written (effectively moving the locking process to within the server).
          Originally posted by DaveM View Post
          Now, if we all used the webserver, rewrote our apps, and connected by way of intranet, we could do what g thinks in a way. Am I right?
          The web doesn't create a magical solution. It's still the same. It's just acting like a client-server

          To reiterate, you can't even share correctly a variable between two different threads/processes/users/CPUs etc on the same computer. One process needs to know if a write is potentially in progress from another thread, and this can't be done without a locking mechanism, unless you want to go with the dangerous concept of whoever writes last, wins (with the exception listed below).

          Imagine you have 2 computers that both read a current inventory quantity of say, 5 units, and for a line item in order 1 purchases 2 widgets and order 2 purchases 1 widget. If you now save the new inventory quantity from order 1, the new inventory value is 3. Then comes order # 2 (having previously read a 5 units) and writes a new inventory value of 4. The correct value should have been 2.

          The reason this works in Alpha 5 posting rules, is that it does a read-modify-write in 1 indivisible operation. At save time it reads the inventory value, decrements the value and writes it back.

          Using a table with locking in the correct way can also accomplish this. But you can't do it with code without using something in Alpha or externally that has an implicit or explicit locking mechanisms allowing a read-modify-write (or equivalent like a test and set)

          Now a global setting that all users have access to that you are willing to have the last person changing it always be the current value, then it is fine (imagine which screen style sheet to use as a setting). It is shared but not used in a cooperative way, and hopefully it doesn't matter too much what the current value is to the individual user.

          This does not need a locking mechanism unless you are changing a group of variables that must be changed all together. Otherwise, someone could read the partially-written values and have read some of them still in the process of change.

          Originally posted by DaveM View Post
          I cannot dim a var that is universal and changeable by all the computers in a days work, it has to be saved in a table or I have to make another way to the server. Come to think about it, that is possible, but is it worth the traffic that could come from it and it still has to be written to a file.
          The overhead of writing a couple of variables (values) to a table is almost nothing compared to normal traffic from the main data.
          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


            Re: A new variable scope

            Originally posted by csda1 View Post
            Gabe:
            But you can't do any Multi-user, multi-thread, or Multi-process operation properly (meaning without errors) without a proper read-modify-write .
            OK.. for the last time:
            1-I acknowledged the multi-users issue from the very early begining.
            2-As I said in my last post, I'll tell you again: you do not need to load a script in order to save a new one, one-user or multi-user.
            Last edited by G Gabriel; 12-17-2007, 12:37 PM.

            Comment

            Working...
            X