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

Post Operation not working with WAS

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

    Post Operation not working with WAS

    I think I found another case of code not functioning on the web while working on the desk top.

    Code:
     
    a_tbl = table.open("spouse")
    post.t_db = "descendents"
    post.m_key = "Key"
    post.t_key = "Key"
    post.m_filter = ""
    post.t_filter = ""
    post.m_count = 9
    post.m_field1 = "Email"
    post.m_exp1 = "if(Email=\"\",@DESCENDENTS->Email,Email)"
    post.m_field2 = "Phone"
    post.m_exp2 = "if(Phone=\"\",@DESCENDENTS->Phonehome,Phone)"
    post.m_field3 = "Cell_Phone"
    post.m_exp3 = "if(Cell_Phone=\"\",@DESCENDENTS->Mobile_Phone,Cell_Phone)"
    post.m_field4 = "Address"
    post.m_exp4 = "if(Address=\"\",@DESCENDENTS->Address_,Address)"
    This is the error
    Script Error
    Error:Script: /automate.a5w line:7
    A5WINCLUDE "functions.a5w"
    Error parsing script
    Script:functions.a5w line:19
    Bad expression character

    Line 19 is post.m_exp1 = "if(Email=\"\",@DESCENDENTS->Email,Email)"

    Suggestions Please

    #2
    None of this will work if you don't first insert the [PathAlias.ADB_Path].

    a_tbl = table.open("[PathAlias.ADB_Path]\spouse")

    Make sure you defined the alias in your profile. Plenty of info on this using the Search feature here.
    -Steve
    sigpic

    Comment


      #3
      Steve This bombed out on the local machine when trying to publish to local webroot. If the "IF" statement isn't vailid then I'm in for a lot of rewriting but I would like verification that it's the problem.

      Comment


        #4
        Found the problem. Alpha writes if() in action scripting when according to the manual to avoid confusion you should use iif(). That did work so far. Now to see if it works in a web situation

        Damn still not parsing when loading the page. Same error as before.
        Last edited by robert swanson; 11-23-2005, 11:47 AM.

        Comment


          #5
          your code is wrong

          post.t_db = "descendents"

          needs to be a fully qualified table name.
          in the case of was application this is probably

          post.t_db = "[PathAlias.AdbPath]\descendents.dbf"

          Comment


            #6
            Selwyn I've changed as suggested but the error stays the same. it doesn't like line 19 amd I assume if it doesn't like 19 it won't like 21,23,25,etc. I thought it was the if statement .
            Code:
             
             
            'Date Created: 12-Nov-2005 10:43:36 PM
            'Last Updated: 16-Nov-2005 03:30:22 PM
            'Created By  : Robert W Swanson
            'Updated By  : Robert W Swanson
            FUNCTION nightrun AS C ( )
            debug(0)
            a_tbl = table.open("[PathAlias.ADB_Path]\spouse")
            post.t_db = ""[PathAlias.AdbPath]\descendents.dbf"
            post.m_key = "Key"
            post.t_key = "Key"
            post.m_filter = ""
            post.t_filter = ""
            post.m_count = 9
            post.m_field1 = "Email"
            post.m_exp1 = "iif(Email=\"\",@DESCENDENTS->Email,Email)"
            post.m_field2 = "Phone"
            post.m_exp2 = "iif(Phone=\"\",@DESCENDENTS->Phonehome,Phone)"
            post.m_field3 = "Cell_Phone"
            post.m_exp3 = "iif(Cell_Phone=\"\",@DESCENDENTS->Mobile_Phone,Cell_Phone)"
            post.m_field4 = "Address"
            post.m_exp4 = "iif(Address=\"\",@DESCENDENTS->Address_,Address)"
            post.m_field5 = "Address2"
            post.m_exp5 = "iif(Address2=\"\",@DESCENDENTS->Address2,Address2)"
            post.m_field6 = "City"
            post.m_exp6 = "iif(City=\"\",@DESCENDENTS->City_,City)"
            post.m_field7 = "Prov_"
            post.m_exp7 = "iif(Prov_=\"\",@DESCENDENTS->Prov_,Prov_)"
            post.m_field8 = "Postalcode"
            post.m_exp8 = "iif(Postalcode=\"\",@DESCENDENTS->Postalcode,Postalcode)"
            post.m_field9 = "Country_"
            post.m_exp9 = "iif(Country_=\"\",@DESCENDENTS->Country_,Country_)"
            post.t_count = 0
            a_tbl.post()
            
            a_tbl.close()
            This is the first part of three similar blocks. Do I have to put the alias in
            ",@DESCENDENTS->Country_, also

            BTW this is not my code but the result of an action script operation. It would seem that the code from the script writer should include qualified paths
            Last edited by robert swanson; 11-23-2005, 12:32 PM.

            Comment


              #7
              Bob, take a closer look at your code:
              Code:
              a_tbl = table.open("[PathAlias.ADB_Path]\spouse")
              post.t_db = ""[PathAlias.AdbPath]\descendents.dbf"
              Notice that the path alias is different in these two lines. Selwyn apparently made a typo when he entered the code for you above, you should fix the second alias to match the first

              Originally posted by robert swanson
              Selwyn I've changed as suggested but the error stays the same. it doesn't like line 19 amd I assume if it doesn't like 19 it won't like 21,23,25,etc. I thought it was the if statement .

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

              Comment


                #8
                Originally posted by Lenny Forziati
                Bob, take a closer look at your code:
                Code:
                a_tbl = table.open("[PathAlias.ADB_Path]\spouse")
                post.t_db = ""[PathAlias.AdbPath]\descendents.dbf"
                Notice that the path alias is different in these two lines. Selwyn apparently made a typo when he entered the code for you above, you should fix the second alias to match the first

                this should be:

                post.t_db = "[PathAlias.AdbPath]\descendents.dbf"

                (with only one set of opening quotes).

                there is no reason why a post operation will not run in a .a5w page.

                however, before putting it in a .a5w page make sure that the xbasic is good by just creating a script and running the script.

                Comment


                  #9
                  Selwyn. The double quotes were from a quick cut and paste. However your code was wrong also as Lenny pointed out. According to the help file the alias should be [PathAlias.ADB_Path] not [PathAlias.AdbPath]

                  Also I reiterate that the code orginally was not mine but yours. It was generated when I used Create New Operation to do a post operation and then I just copied the Xbasic code.

                  I made the corrections mentioned above and it still aborts at the line containing the iif() statement.
                  Script Error
                  Error:Script: /automate.a5w line:7
                  A5WINCLUDE "functions.a5w"
                  Error parsing script
                  Script:functions.a5w line:19
                  Bad expression character

                  Do I have to add the alias to "iif(Email=\"\",@DESCENDENTS->Email,Email)"
                  Last edited by robert swanson; 11-23-2005, 01:03 PM.

                  Comment


                    #10
                    Originally posted by robert swanson
                    Selwyn. The double quotes were from a quick cut and paste. However your code was wrong also as Lenny pointed out. According to the help file the alias should be [PathAlias.ADB_Path] not [PathAlias.AdbPath]

                    Also I reiterate that the code orginally was not mine but yours. It was generated when I used Create New Operation to do a post operation and then I just copied the Xbasic code.
                    Robert --

                    You need to understand that just because something works on the desktop doesn't mean it's perfectly portable to the web app. There are also some things you might build with the web app tools that won't work on the desktop. Simply put, you're building applications for different platforms. You've been around long enough to understand that, and I don't think you're going to get anything done or changed by insisting to Alpha that this should work. I know it's frustrating sometimes but keep in mind the differences as you build and you'll have fewer of these problems.

                    Even Selwyn's typo shouldn't have thrown you -- you need to understand what [PathAlias.ADB_Path], where it comes from and how to use it. He was simply pointing out an omission on your part in the necessary modification of code. There's lots of info about this as I pointed out in my initial response to you, and understanding this point is critical to the successful construction of your web app.
                    -Steve
                    sigpic

                    Comment


                      #11
                      Steve I'm well aware that some things don't transport and yes I should have picked up on Selwyns error but everyone including you is not answering the question I've asked.

                      Post operations are not described in the manual in detail except in reference to action scripting or creating operations. The syntax of
                      Code:
                      post.m_exp1 = "iif(Email=\"\",@DESCENDENTS->Email,Email)"
                      is what I want clarified as that's where the error is reported.

                      I do try to find my own solutions but I can't find any references for anything in this piece of code. I probably can write a chunk of code to replace this, but as Selwyn said "It should work".

                      PS I didn't think that [PathAlias.ADB_Path] was required when using the local WAS and I wanted to see if all the rest worked.
                      Last edited by robert swanson; 11-23-2005, 02:42 PM.

                      Comment


                        #12
                        iif() is a function documented in the Webhelp and other documentation available.

                        Email=\"\" is testing to see if Email is empty

                        @DESCENDENTS->Email is the email field in your transaction table, Descendents

                        Email is the Email field in your main table, spouse

                        Since your Descendents table is not properly defined without the alias, @DESCENDENTS is meaningless when this line of code is executed. Fixing the table definition to include the path will make @DESCENDENTS valid.


                        Originally posted by robert swanson
                        Steve I'm well aware that some things don't transport and yes I should have picked up on Selwyns error but everyone including you is not answering the question I've asked.

                        Post operations are not described in the manual in detail except in reference to action scripting or creating operations. The syntax of
                        Code:
                        post.m_exp1 = "iif(Email=\"\",@DESCENDENTS->Email,Email)"
                        is what I want clarified as that's where the error is reported.

                        I do try to find my own solutions but I can't find any references for anything in this piece of code. I probably can write a chunk of code to replace this, but as Selwyn said "It should work".

                        PS I didn't think that [PathAlias.ADB_Path] was required when using the local WAS and I wanted to see if all the rest worked.

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

                        Comment


                          #13
                          Lenny I did fix all the alias references and correctly this time before sending the last message.

                          Code:
                           
                           
                          'Date Created: 12-Nov-2005 10:43:36 PM
                          'Last Updated: 16-Nov-2005 03:30:22 PM
                          'Created By  : Robert W Swanson
                          'Updated By  : Robert W Swanson
                          FUNCTION nightrun AS C ( )
                          debug(0)
                          a_tbl = table.open("[PathAlias.ADB_Path]\spouse.dbf")
                          post.t_db = "[PathAlias.ADB_Path]\descendents.dbf"
                          post.m_key = "Key"
                          post.t_key = "Key"
                          post.m_filter = ""
                          post.t_filter = ""
                          post.m_count = 9
                          post.m_field1 = "Email"
                          post.m_exp1 = "iif(Email=\"\",@DESCENDENTS->Email,Email)"
                          post.m_field2 = "Phone"
                          post.m_exp2 = "iif(Phone=\"\",@DESCENDENTS->Phonehome,Phone)"
                          post.m_field3 = "Cell_Phone"
                          post.m_exp3 = "iif(Cell_Phone=\"\",@DESCENDENTS->Mobile_Phone,Cell_Phone)"
                          post.m_field4 = "Address"
                          post.m_exp4 = "iif(Address=\"\",@DESCENDENTS->Address_,Address)"
                          post.m_field5 = "Address2"
                          post.m_exp5 = "iif(Address2=\"\",@DESCENDENTS->Address2,Address2)"
                          post.m_field6 = "City"
                          post.m_exp6 = "iif(City=\"\",@DESCENDENTS->City_,City)"
                          post.m_field7 = "Prov_"
                          post.m_exp7 = "iif(Prov_=\"\",@DESCENDENTS->Prov_,Prov_)"
                          post.m_field8 = "Postalcode"
                          post.m_exp8 = "iif(Postalcode=\"\",@DESCENDENTS->Postalcode,Postalcode)"
                          post.m_field9 = "Country_"
                          post.m_exp9 = "iif(Country_=\"\",@DESCENDENTS->Country_,Country_)"
                          post.t_count = 0
                          a_tbl.post()
                          
                          a_tbl.close()
                          Here is the code which was just tested and the reuslts are the same. When the calling page tries to insert this page it still gives the error shown in earlier posts.

                          Comment


                            #14
                            Just tried the following
                            Code:
                             
                            FUNCTION nightrun AS C ( )
                            a_tbl = table.open("[PathAlias.ADB_Path]\spouse.dbf")
                            post.t_db = "[PathAlias.ADB_Path]\descendents.dbf"
                            post.m_key = "Key"
                            post.t_key = "Key"
                            post.m_filter = ""
                            post.t_filter = ""
                            post.m_count = 9
                            post.m_field1 = "Email"
                            if Email=\"\" then
                            post.m_exp1 = "@DESCENDENTS->Email"
                            else
                            post.m_exp1 = "Email"
                            end if
                            post.m_field2 = "Phone"
                            post.m_exp2 = "iif(Phone=\"\",@DESCENDENTS->Phonehome,Phone)"
                            post.m_field3 = "Cell_Phone"
                            with the following error

                            Script Error
                            Error:Script: /automate.a5w line:7
                            A5WINCLUDE "functions.a5w"
                            Error parsing script
                            Script:functions.a5w line:19
                            Extra characters at end of expression

                            line 19 is the if statement.
                            Last edited by robert swanson; 11-24-2005, 10:04 PM.

                            Comment


                              #15
                              Bob, the code you posted introduced a new problem. The expression
                              Code:
                              if Email=\"\" then
                              post.m_exp1 = "@DESCENDENTS->Email"
                              else
                              post.m_exp1 = "Email"
                              end if
                              is invalid inthat context as the backslash is indicating to ignore the ". The result is that the code would be trying to set the value of a variable "Email" to some value instead of evaluating the expression, which is creating the error. If the \"\" is replaced with "", then the expression will be looking for a variable named "Email" which must be defined on the page, and will still generate an error.

                              Actually, the code

                              Code:
                              post.m_field2 = "Phone"
                              post.m_exp2 = "iif(Phone=\"\",@DESCENDENTS->Phonehome,Phone)"
                              is correct. The only time a quote needs to be preceeded by a backslash is if the quotes are embeded within other quotes.

                              I have attached a little zip file with a sample application that tried to mimic your setup. The post does run correctly from the web page. The web page "post_test" shows one method to "debug" xbasic on a web page by outputting a message to the page to indicate the results from the code

                              Originally posted by robert swanson
                              Code:
                               
                              FUNCTION nightrun AS C ( )
                              a_tbl = table.open("[PathAlias.ADB_Path]\spouse.dbf")
                              post.t_db = "[PathAlias.ADB_Path]\descendents.dbf"
                              post.m_key = "Key"
                              post.t_key = "Key"
                              post.m_filter = ""
                              post.t_filter = ""
                              post.m_count = 9
                              post.m_field1 = "Email"
                              if Email=\"\" then
                              post.m_exp1 = "@DESCENDENTS->Email"
                              else
                              post.m_exp1 = "Email"
                              end if
                              post.m_field2 = "Phone"
                              post.m_exp2 = "iif(Phone=\"\",@DESCENDENTS->Phonehome,Phone)"
                              post.m_field3 = "Cell_Phone"

                              Comment

                              Working...
                              X