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

Breaking Changes for Alpha Five V11

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

    Breaking Changes for Alpha Five V11

    The WiKI says this:

    http://wiki.alphasoftware.com/Breaki...on#Ulink_Field

    Don't do an eval_valid() to test a session variable. Instead, assign the value of a session variable to a normal variable once per page, and test to make sure that the value of the normal variable is not null before using the value.
    And when I do that, I get this error:
    500 Internal Server Error

    Script Error
    Error:Script:" /ACME/xVarsTest.a5w" line:16
    vProjectid = session.projectid
    Property not found
    session.projectid subelement not found.

    Alpha Five/11.0 Build/2291-3841 at DELL_545 Port 80
    From this simple code:
    Code:
    <%a5
    vProjectid = session.projectid 
    ? "session.Projectid  = " + vProjectid + "<br>"
    %>
    If your session variable is not valid you are passing the error to the a5w page. The WiKi doesn't make sense here - or what am I missing?
    Peter
    AlphaBase Solutions, LLC

    [email protected]
    https://www.alphabasesolutions.com



    #2
    Re: Breaking Changes for Alpha Five V11

    Originally posted by Peter.Greulich View Post
    Code:
    <%a5
    vProjectid = session.projectid 
    ? "session.Projectid  = " + vProjectid + "<br>"
    %>
    If your session variable is not valid you are passing the error to the a5w page. The WiKi doesn't make sense here - or what am I missing?
    Variables can be created in a couple ways, typically explicitly or implicitly. Help link here. An explicit method is to declare the variable and give it a type, which in xbasic would be
    Code:
    dim session.projectid as c
    An implicit method, which is what the wiki is referring to, is setting the variable to some existing value and the variable will be created with the value and type of the value. In your xbasic that would be
    Code:
    session.projectid = ""
    In simplist terms, the left side of the equation is being set to the value on the right side of the equation. In your example, an error is generated because the right side of the equation (the session variable) does not yet exist.

    If you try to explicitly declare a session variable (or any other variable) by declaring it with a "dim" and it already exists, basically noting happens. The existing variable is unaffected as far as type and value. So if you do this
    Code:
    session.MyName = "Peter"
    dim session.MyName as c
    session.MyName is still equal to "Peter". If in doubt about the existence of a variable, re-dimming the variable will insure it exists.

    The reason eval_valid() is not recommended for session variables in V11 is overhead. Session variables are no longer simple pointer variable as in earlier servers. The session is now an object that has values as properties. This change is required for future expansion into IIS and other reasons. However, this causes a function such as eval_valid() to be slower than in the past. The difference is very small, on the order of a milllisecond or 2, but small times can eventually add up to noticable impacts. Because of recent changes, declaring the variable with a dim or setting the value implicitly is now faster than eval_valid().

    Comment


      #3
      Re: Breaking Changes for Alpha Five V11

      Aha!

      That explains why my old technique of creating session variables as pointers, like
      dim session.customer as p
      session.customer.firstname = "Billy"
      session.customer.lastname = "Bob"

      is no longer working.

      I know, Alpha never said that creating session variables as pointers was supported, just like they never said it was OK to use Server variables (which also no longer seems to work), but it was an unhappy surprise to find it when upgrading my older apps to V11.

      The good news is the "Search in all web components and pages" capability has been a lifesaver. It shows every component and page that needs changing (like eval_valid to variable_exists) and the line it is in. Big time saver and a feeling of comfort that you caught them all. With that tool, it is only taking about 1/2 day per app to update them.

      Now, if they would just add a "search and replace" capability to change all those instances it finds, it would be even better.
      Pat Bremkamp
      MindKicks Consulting

      Comment


        #4
        Re: Breaking Changes for Alpha Five V11

        Thanks for the reminder, Jerry. I've gotten lazy recently relying on eval_valid and not bothering to dim session vars.
        Last edited by Peter.Greulich; 12-19-2011, 10:46 AM.
        Peter
        AlphaBase Solutions, LLC

        [email protected]
        https://www.alphabasesolutions.com


        Comment


          #5
          Re: Breaking Changes for Alpha Five V11

          Just upgraded app server to v11. Getting session error. I'm still not sure what change is required. I've removed eval_valid() from the a5w page but still get the error. I have a button which opens the a5w page. It opens the page with a URL where a session variables is set. I get a subelement not found error. See attachments. Pages are server are still v10. Do I need to open and publish each page? This worked on v10.

          URL
          UploadAttachments.a5w?session.WhatClient_ID={Client_ID}&session.WhatHistory_ID=0

          Error
          vClient_ID = session.WhatClient_ID
          session.WhatClient_ID subelement not found
          Attached Files

          Comment


            #6
            Re: Breaking Changes for Alpha Five V11

            Originally posted by iviowa View Post
            URL
            UploadAttachments.a5w?session.WhatClient_ID={Client_ID}&session.WhatHistory_ID=0

            Error
            vClient_ID = session.WhatClient_ID
            session.WhatClient_ID subelement not found
            In V11 WAS, you can no longer set session variables in a URL.

            Code:
            URL
            UploadAttachments.a5w?WhatClient_ID={Client_ID}&WhatHistory_ID=0
            
            xbasic
            session.WhatClient_ID = Request.Variables.WhatClient_ID
            session.WhatHistory_ID = Request.Variables.WhatHistory_ID

            Comment


              #7
              Re: Breaking Changes for Alpha Five V11

              Sparticuz is correct. From Server Programming Changes for Version 11:
              Session Variables cannot be created directly from a request query string or POST body. This negates the need to use "protected" session variables, as all session variables now effectively "protected". In order to create a session variable, you must execute A5W code to read the request variable and create or set the session variable. A request for a URL such as http://localhost/index.a5w?session.name=John will not create a session variable session.name, but will instead create a request variable which may be accessed as Request.Variables.session.name during the lifetime of that request only.

              Code:
              dim Session.Name as c = Request.Variables.Name

              Lenny Forziati
              Vice President, Internet Products and Technical Services
              Alpha Software Corporation

              Comment


                #8
                Re: Breaking Changes for Alpha Five V11

                Thanks. This worked for the 2 session variables passed in via a URL that call this a5w page. I have 1 other session variable this is set when the customer logs in. It's NOT a protected variable. Trying to get that value gives the following error. Do I get that session variable in a different way?

                Script Error
                Error:Script:" /UploadAttachments.a5w" line:42
                dim session.WhatUser as c = Request.Variables.session.WhatUser
                Property not found

                Comment


                  #9
                  Re: Breaking Changes for Alpha Five V11

                  Request.Variables.WhatClient_ID will sometimes give me a Property Not Found error. I tried eval_valid(Request.Variables.WhatClient_ID) but that didn't work.
                  I get the error because this page is used to upload a file. After the upload is complete it hits the code below again, causing me a Property Not Found error. It's okay when I open the page intially but not after hitting the code a second time after the upload.
                  Code:
                  session.WhatClient_ID = Request.Variables.WhatClient_ID

                  Comment


                    #10
                    Re: Breaking Changes for Alpha Five V11

                    Try using variable_exists()

                    http://wiki.alphasoftware.com/variable_exists+Function

                    Comment


                      #11
                      Re: Breaking Changes for Alpha Five V11

                      Originally posted by Sparticuz View Post
                      Thanks Sparticuz! Did not know about this.
                      I will be replacing the few instances I have used eval_valid() with variable_exists()

                      Comment


                        #12
                        Re: Breaking Changes for Alpha Five V11

                        Thanks but that didn't work. I still get the Property not found error.
                        Code:
                        If variable_exists(Request.Variables.WhatClient_ID)
                        Any other ideas?

                        Comment


                          #13
                          Re: Breaking Changes for Alpha Five V11

                          You need to quote the variable.
                          Code:
                          If variable_exists([COLOR="#FF0000"]"[/COLOR]Request.Variables.WhatClient_ID[COLOR="#FF0000"]"[/COLOR])
                          Jim Coltz
                          Alpha Custom Database Solutions, LLC
                          A5CustomSolutions.com
                          [email protected]

                          Comment


                            #14
                            Re: Breaking Changes for Alpha Five V11

                            That is exactly what I needed. Thank you.

                            Comment

                            Working...
                            X