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



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

How to make Server Vars persistant.

  • Filter
  • Time
  • Show
Clear All
new posts

  • How to make Server Vars persistant.

    I have an application where the best arrangement and scope of variables is as server variables. {not application or session}
    The drawback is that everytime the server is restarted, the server variables are removed.
    I am considering making any change to the server variables to be stored in a registry field.
    But .... What event is fired whence the server is started.
    An event must be started as the 3 logs all indicate they recieve notification.
    Any hints appreciated.
    (I realise the other method is to test for existance when required of the variables however this seems ugly to me.)

  • #2
    Re: How to make Server Vars persistant.

    This may be "ugly", but I created a table named "version" and a page named ServerVarTest.a5w as follows:
    '==== get section info into server variables if needed
    If eval_valid("server.number")=.f."[PathAlias.ADB_Path]\version")
     server.version = alltrim(stbl.Ver_no)
     server.number = alltrim(stbl.En_id) = alltrim(stbl.En_name)
     server.address = alltrim(stbl.En_adr1)
     server.citystzip = alltrim(stbl.En_city)+", "+alltrim(stbl.En_state)+" "+alltrim(stbl.En_zip)+"-"+stbl.En_zip4
     server.logoname = alltrim(stbl.Logoname)
     server.logohigh = alltrim(stbl.Logohigh)
     server.logowide = alltrim(stbl.Logowide)
     server.logoalt = alltrim(stbl.Logoalt)
     server.copyright = alltrim(stbl.En_footer1)
     server.footer1 = alltrim(stbl.En_footer2)
     server.footer2 = alltrim(stbl.En_footer3) = alltrim(stbl.En_website)
    end if
    Then at the top of each page, I just

    Pat Bremkamp
    MindKicks Consulting


    • #3
      Re: How to make Server Vars persistant.

      Pat , that is exactly the same, apart form tbl an var names, to what I have been using.
      I just keep thinking there must be a better way than using the eval_valid("
      type test.


      • #4
        Re: How to make Server Vars persistant.

        What's wrong with using eval_valid()? It just says if that variable is missing, to reset all from the table, else assume they are all set.
        Steve Wood
        There is no Cloud. It's just someone else's computer.
        Web - Mobile - Hosting - Products - Frameworks - Developer Resources
        AlphaToGo | IADN (100% Alpha Anywhere Websites)


        • #5
          Re: How to make Server Vars persistant.

          Steve, Ill give you, Eval_Valid functions and is reliable.
          However I wonder how it will perform as a function in a multi threaded environment, where I believe most of us are heading. I consider it to be a function to be used for safety testing rather than falling back on error_handling routines. Thus using it as as a standard code requirement (similar to the file-upload situation on here yesterday) just doesn't seem right to me. Similar other evaluation type functions in XBAsic I avoid if possible.


          • #6
            Re: How to make Server Vars persistant.

            I've never heard anyone else mention multi-threaded regarding Alpha web apps, so I think your out front. Eval_valid() just checks if the expression is valid, don't know how that would be affected by multiple threads. Each thread would need the same check I guess.

            If it helps, here is an old video on how to "Make an Autoexec for your Alpha Application Server". It uses AlwaysUP and CURL. The example sets the CPU and sends an email saying the server restarted.

            Steve Wood
            There is no Cloud. It's just someone else's computer.
            Web - Mobile - Hosting - Products - Frameworks - Developer Resources
            AlphaToGo | IADN (100% Alpha Anywhere Websites)


            • #7
              Re: How to make Server Vars persistant.

              Make an Autoexec for your Alpha Application Server".
              Ah, That was the kick in the pants I needed, I should have thought of an AutoExec First !
              Note: Threading
              I running into aprox one new threading issue a fortnight, principally thanks to AJAX callbacks, I have been surprised at how few others on this board are reporting issues with it. I'm unsure how the new V10 grid will handle this. Currently the Application Server appears to only handle one thread per session, However bogus_sessions allow for extra threads.


              • #8
                Re: How to make Server Vars persistant.

                Can you expand on how threading will or may affect the AJAX grids. I mean if we are not specifically creating multi-threaded applications, is this a potential problem? Or do you mean by nature, the AJAX callbacks and grid ARE making our apps multi threaded just by their use?
                Steve Wood
                Join the ALPHA DEVELOPERS NETWORK
                There is no Cloud. It's just someone else's computer.
                Web - Mobile - Hosting - Products - Frameworks - Developer Resources
                AlphaToGo | IADN (100% Alpha Anywhere Websites)


                • #9
                  Re: How to make Server Vars persistant.

                  Will try to explain, (if I don't overly confuse myself) :-)
                  My situation is that I am using and probably overusing AJAX functions and call backs, with my maps etc.
                  Ok, a webpage
                  May fire two functions
                  which returns ?"alert('Return First');"
                  and then ?"alert('Return Second');"

                  next 2.)
                  which returns ?"alert('Return Third');"
                  and then ?"alert('Return Fourth');"

                  Ok here we have no guarantee that the REturned callbacks will be in the order
                  Return First, Return Second, Return Third, Return Fourth
                  This is because A. the servers are different for the two AJAX functions,
                  Also with internet slowness issues a problem can exist.
                  Obviously the example above gets more complicated and can return more unexpected results.

                  Thus I'm learning now to write code that is more robust,
                  In the simple form,
                  Only fire 1 callback function at a time, then to queue subsequent functions until the last result has been returned. if the wait is too long fire another callback.
                  ii.) on the AJAX.a5w pages, to only return the functions etc as one statement back to the client page.

                  Another problem is different browsers handle callback timing differently eg event bubbling and event boiling. So a quick fix may work on one setup but not another
                  If Alpha have designed the V10 grid well I doubt this will be an issue, however if a developer decides to intergrate a 3rd party json type feed into a grid there may well be conflicts. Remembering Xbasic is essentially synchronous whilst javascipt and AJAX are Asynchronous with one or two exceptions.


                  • #10
                    Re: How to make Server Vars persistant.

                    event bubbling and event boiling
                    Any Event Gurgling? Your description did make perfect sense and I see how AJAX adds the potential for multiple threads. The above metaphor works (multiple events from a single source) except it misses that the events may be dependent on each other.

                    As a comparison, I know when I use Xbasic to ask for a response from another web page, it waits until the response is received before continuing. Even if the response is never received, the function has to be set to time out, or the browser times out on its own. Only then does it continue with the rest of the script. The other perfect example is when a web page script sends an email and the browser 'hangs' while it sends the email*. That's single threaded. If it were multi-threaded, the instruction to send the email would go on a new thread and the browser would respond instantly - and the email would be sent out on a different thread.

                    I see how this changes things since, as a developer, I currently rely on that single threaded timing.

                    *I never send an email as part of a Grid event because of this.
                    Steve Wood
                    Join the ALPHA DEVELOPERS NETWORK
                    There is no Cloud. It's just someone else's computer.
                    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
                    AlphaToGo | IADN (100% Alpha Anywhere Websites)