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

help with xbasic append PLEASE!!!

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

    help with xbasic append PLEASE!!!

    I have a problem with append in Xbasic. I can create an append with the genie and it works fine but if I convert it to xbasic via the script recorder and then run the script I get a fields and expression must be equal error. The converted script is below. If I convert to high level script it works fine as well.

    a_tbl = table.current()
    append.t_db = "c:ted's autoted's auto archiveted's auto.dbf"
    append.m_key = ""
    append.t_key = ""
    append.m_filter = ""
    append.t_filter = "LHOURS1>0"
    append.type = "All"
    append.m_count = 5
    append.m_field1 = "Employee"
    append.m_exp1 = "Ted_S_Auto->Emp1"
    append.m_field2 = "Invocno"
    append.m_exp2 = "Ted_S_Auto->Invocno"
    append.m_field3 = "Lhours"
    append.m_exp3 = "Ted_S_Auto->Lhours1"
    append.m_field4 = "Datepaid"
    append.m_exp4 = "Ted_S_Auto->Datepaid"
    append.m_field5 = "Ldesc"
    append.m_exp5 = "Ted_S_Auto->Ldesc1"
    append.t_count = 0
    a_tbl.append()

    I tried all the things I could find on the message boards, changing line 1 to a_tbl = table.open("labor"), adding a @ to append.m_exp1 = "@ted_Auto->Emp1" and etc to the other append.m_exp lines. Still Same Error.

    debug shows the error happening on the last line a_tbl.append().

    tried redoing the append to only 1 field, same error. tried redoing to a different 1 field, same error.

    The transaction dbf has 50 or so fields, master has only 5. those 5 are identical to the 5 I am trying to append. 2 character, 2 num, and 1 date. they are the same type have the same width, and decimals etc.

    So what can I do next??? This is making me crazy!

    #2
    RE: help with xbasic append PLEASE!!!

    Ronald,

    Assuming you are running the low level script from a form based on the table which is receiving the append records this should have been very easy. i.e. form is based on the master table.

    Here's an example which illustrates how high level and low level appends might be implemented in that situation.

    The low level script would have to be modified if it were running on a form that is *not* based on the master table.

    -- tom

    Comment


      #3
      RE: help with xbasic append PLEASE!!!

      Thanx Tom
      I finally solved the problem by creating a form based on the Labor.dbf and putting the button to run the script on that form. works fine from there, just won't work if called from another form. Guess I can get by with that solution

      Comment


        #4
        RE: help with xbasic append PLEASE!!!

        Ronald,

        the first line of your script creates a pointer to the 'current' table.

        a_tbl = table.current()


        If this script is in a form based on a different table than your master table, it will fail. why? because that form is not based on the master table. The function table.current() returns the pointer to the table on which current form is based... not a pointer to the table you want to append to.

        This is why the script works when you put it on a form based on the table to which records are being appended.

        The fix is often very easy.

        change

        a_tbl = table.current()


        to


        a_tbl = table.open("your master table name goes here")



        Then add a


        a_tbl.close() at the bottom of the script, just before it ends, but after the append is completed.


        -- tom

        Comment


          #5
          RE: help with xbasic append PLEASE!!!

          Hi ya,
          I did try what you suggested but it didn't work. Don't know why?

          Comment


            #6
            RE: help with xbasic append PLEASE!!!

            Ronald,

            I do it just like tom saya and it does work

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

            Comment


              #7
              RE: help with xbasic append PLEASE!!!

              "Hi ya, I did try what you suggested but it didn't work."

              Didn't work as in didn't do anything, or didn't work as in returned an error message?

              1. Check your spelling of the table name in the table.open("tablename") statement.

              2. Change the statement to reflect the complete path, table.open("c:\somedirectory\tablename.dbf") - if this works your "tablename" is in a different directory from the rest of your files.

              3. I would avoid the use of most punctuation in directory and file names, i.e. "ted's". This can really confuse a program trying to parse an expression. Single quotes inside double quotes are "looking for trouble" syntax. Avoid blank spaces between words in directory and file names, as well. Underscores are most often used if you must have character separation.
              There can be only one.

              Comment


                #8
                RE: help with xbasic append PLEASE!!!

                hi ya
                Didn't work as in returns the error message field types must match. Seems to be finding the table but does not like the field types unless I the button is on a form attached to the labor dbf. I don't understand it, just know it does work

                Ron

                Comment


                  #9
                  RE: help with xbasic append PLEASE!!!

                  Ron,

                  You may be running the append script from a form that is based on one or more of the tables from which records will be retrieved.

                  Those tables are opened by Alpha Five when the form opens.

                  Those tables get opened again by the Append function.

                  When the second instance of the tables is opened, Alpha Five gives the table a new alias, in order to keep that instance of the table separate from the instance which opened when the form opened. The alias is of course different from the table name, and the append function tries to use the tablename to identify the fields from which values are to be retrieved. Hence, Alpha Five can't see the fields and the append fails.

                  The solution would be to call the append script from a form that is not based on any of the transaction tables involved in the append.

                  -- tom

                  Comment


                    #10
                    RE: help with xbasic append PLEASE!!!

                    Folks
                    I gotta tell ya, Tom is a wizard. I understand what was happening now and loading the script from another form did indeed solve the problem. All I can say is thanks ever so much to all of you for the advice. I would never have solved the problem on my own.

                    Comment


                      #11
                      RE: help with xbasic append PLEASE!!!

                      Good call Tom.
                      John

                      Comment


                        #12
                        RE: help with xbasic append PLEASE!!!

                        Thanks, but no wizardry was involved. I just happened to have had a nasty encounter with the same issue some time ago and it left a 'vivid' impression. The solution was more a case of revisiting old battlegrounds, than any fresh 'new' insight.

                        The problem Ron was having issue is related to the behavior I often forget about while trying to open a set when one of its tables is already open. I've made myself go back and read the entire discussion of table.open() so many times, I can just about recite it verbatim... and I still manage to forget how the automatic aliasing works.

                        -- tom

                        Comment

                        Working...
                        X