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

differences between code command file and the code in a command button on a form

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

    differences between code command file and the code in a command button on a form

    What are the differences between code command file and the code in a command button on a form?
    The code file works good when run the code ("v_wl") in the Control Panel or in the Interactive Window using script_play_local("v_wl"). But I got the following error when run the same code or using script_play_local("v_wl") on a form: Error running append operation Argument is incorrect data type.
    The code is for appending all records from one table to another (with a few calculated fields). And I got the same problem after change the calculated fields to user entered.

    #2
    Re: differences between code command file and the code in a command button on a form

    What are the differences between code command file and the code in a command button on a form?
    The context.

    Without seeing the code/script it would be difficult to pinpoint the issue. Script_play_local() allows you to reference variables defined in the current variable namespace. If the variables available to the form are different, the results when the command is issued from the form might be different.
    There can be only one.

    Comment


      #3
      Re: differences between code command file and the code in a command button on a form

      The code file the the calling function file are uploaded. Thanks a lot for your help.
      FJ

      Comment


        #4
        Re: differences between code command file and the code in a command button on a form

        You have two append operations in the u_sql...... script. Does the first one run and the second fail?

        Change the notification to find out.

        Line 90 -
        ui_msg_box("Error","Error running FIRST Append Operation"+crlf()+error_text_get())

        Line 175 -
        ui_msg_box("Error","Error running SECOND Append Operation"+crlf()+error_text_get())
        There can be only one.

        Comment


          #5
          Re: differences between code command file and the code in a command button on a form

          Thanks a lot. This is a very good way to find out where caused the problem. And I got:
          "Error running FIRST Append Operation"

          Comment


            #6
            Re: differences between code command file and the code in a command button on a form

            I believe you need to change this line

            vv6=c1;vv7= "wl5";vv9= "wl0";

            to

            vv6="@"+c1;vv7= "wl5";vv9= "wl0";

            and

            vv6="wl5";vv7= "pav5" + api_getenvironmentvar("usr");vv9= "pa";vv9v=vv9+"@"+vv7

            to

            vv6="@wl5";vv7= "pav5" + api_getenvironmentvar("usr");vv9= "pa";vv9v=vv9+"@"+vv7
            There can be only one.

            Comment


              #7
              Re: differences between code command file and the code in a command button on a form

              It does not work and I got the following error on both the code file and the command button: "Error running FIRST Append Operation; Variable append.t_db table - the system cannot find the file specified. d:\a5\@wlab5.dbf"

              Comment


                #8
                Re: differences between code command file and the code in a command button on a form

                Sorry, I did not see where vv6 was used in that table open statement.

                Code:
                vv6=c1;vv7= "wl5";vv9= "wl0";[COLOR="Red"]basename= "@"+c1[/COLOR]
                Then the FIRST append needs

                Code:
                append.m_exp1 =  [COLOR="red"]basename[/COLOR] + "->recno0"
                append.m_field2 = "chkno"
                append.m_exp2 =  basename + "->chkno"
                append.m_field3 = "ptname"
                append.m_exp3 =  basename + "->ptname"
                append.m_field4 = "chkinf"
                append.m_exp4 =  basename + "->chkinf"
                append.m_field5 = "chkdata"
                append.m_exp5 =  basename + "->chkdata"
                append.m_field6 = "jpath"
                append.m_exp6 =  basename + "->jpath"
                append.m_field7 = "spath"
                append.m_exp7 =  basename + "->spath"
                append.m_field8 = "path"
                append.m_exp8 =  basename + "->path"
                append.m_field9 = "chkrec"
                append.m_exp9 =  basename + "->chkrec"
                append.m_field10 = "chksured"
                append.m_exp10 =  basename + "->chksured"
                append.m_field11 = "chkcode"
                append.m_exp11 =  basename + "->chkcode"
                append.m_field12 = "ptbirth"
                append.m_exp12 =  basename + "->ptbirth"
                append.m_field13 = "ptid"
                append.m_exp13 =  basename + "->ptid"
                append.m_field14 = "chartno"
                append.m_exp14 =  basename + "->chartno"
                append.m_field15 = "pasdate"
                append.m_exp15 =  basename + "->pasdate"
                append.m_field16 = "chkqul"
                append.m_exp16 =  basename + "->chkqul"
                append.m_field17 = "chkdif"
                append.m_exp17 =  basename + "->chkdif"
                append.m_field18 = "chkdif2"
                append.m_exp18 =  basename + "->chkdif2"
                append.m_field19 = "hona9"
                append.m_exp19 =  basename + "->hona9"
                append.m_field20 = "prechkdata"
                append.m_exp20 =  basename + "->prechkdata"

                Code:
                vv6="wl5";vv7= "pav5" + api_getenvironmentvar("usr");vv9= "pa";vv9v=vv9+"@"+vv7;[COLOR="red"]basename = "@"+vv6[/COLOR]
                Then the SECOND append needs

                Code:
                append.m_exp2 =  [COLOR="red"]basename[/COLOR] + "->Chartno"
                append.m_field3 = "Pano"
                append.m_exp3 =  basename + "->Chkno"
                append.m_field4 = "Ptna"
                append.m_exp4 =  basename + "->Ptname"
                append.m_field5 = "Ptag"
                append.m_exp5 =  basename + "->Ag_c"
                append.m_field6 = "Ptsx"
                append.m_exp6 =  s_quote("F")
                append.m_field7 = "D_rc"
                append.m_exp7 =  basename + "->Chkrec"
                append.m_field8 = "D_rp"
                append.m_exp8 =  basename + "->Chksured"
                append.m_field9 = "Padx"
                'append.m_exp9 =  basename + "->Chkdata"
                'append.m_exp9 = evaluate_string("alltrim({basename}->Chkdata)+('  inf=')+alltrim({basename}->chkinf) + ('  qul=')+({basename}->chkqul) + ('  difc=')+({basename}->chkdif) + ('  dif2=')+({basename}->chkdif2) + ('  jpath=')+({basename}->jpath) + ('  spath=')+({basename}->spath) + ('  ptID=')+({basename}->ptID)")
                append.m_exp9 = "if((isnull("+basename+"->prechkdata) .or. alltrim("+basename+"->prechkdata)=alltrim("+basename+"->chkdata)),alltrim("+basename+"->Chkdata)+('  inf=')+alltrim("+basename+"->chkinf)+('  qul=')+("+basename+"->chkqul)+('  difc=')+("+basename+"->chkdif)+('  dif2=')+("+basename+"->chkdif2)+('  jpath=')+("+basename+"->jpath)+('  spath=')+("+basename+"->spath)+('  dx0=sm')+('  ptID=')+("+basename+"->ptID),alltrim("+basename+"->Chkdata)+('  inf=')+alltrim("+basename+"->chkinf)+('  qul=')+("+basename+"->chkqul)+('  difc=')+("+basename+"->chkdif)+('  dif2=')+("+basename+"->chkdif2)+('  jpath=')+("+basename+"->jpath)+('  spath=')+("+basename+"->spath)+('  dx0=')+("+basename+"->prechkdata)+('  ptID=')+("+basename+"->ptID))"
                
                append.m_field10 = "Cldr"
                append.m_exp10 =  s_quote("")
                append.m_field11 = "Padr"
                append.m_exp11 =  basename + "->Path"
                append.m_field12 = "Mid_ho1"
                append.m_exp12 =  s_quote("")
                append.m_field13 = "Cldx"
                append.m_exp13 =  s_quote("")
                append.m_field14 = "Dxdif"
                append.m_exp14 =  s_quote(0)
                append.m_field15 = "Dw"
                append.m_exp15 =  s_quote(0)
                append.m_field16 = "Hona9"
                append.m_exp16 =  basename + "->Hona9"
                append.m_field17 = "Ptid"
                append.m_exp17 =  basename + "->Ptid"
                append.t_count = 0
                Any table name in a line like

                append.m_exp17 =

                must have the right side like

                @tablename->fieldname

                when it refers to a table field.
                Last edited by Stan Mathews; 05-25-2010, 08:46 AM.
                There can be only one.

                Comment


                  #9
                  Re: differences between code command file and the code in a command button on a form

                  After using your attached file, I still got the error of:
                  "Error running FIRST Append Operation; Argument is incorrect data type.
                  when using the command button.
                  FJ

                  Comment


                    #10
                    Re: differences between code command file and the code in a command button on a form

                    After checking the tables. Both wlab5 and wl5 have got the appended records. Even with the error message. But the last table "pav5" + api_getenvironmentvar("usr") cannot get the records.
                    FJ

                    Comment


                      #11
                      Re: differences between code command file and the code in a command button on a form

                      There were a few lines in the script where I did not change vv6 to basename. Try this.
                      There can be only one.

                      Comment


                        #12
                        Re: differences between code command file and the code in a command button on a form

                        The script2.txt still got the error of: "Error running FIRST Append Operation; Argument is incorrect data type.
                        After checking the tables. Both wlab5 and wl5 have got the appended records. Even with the error message. But the last table "pav5" + api_getenvironmentvar("usr") cannot get the records.

                        Comment


                          #13
                          Re: differences between code command file and the code in a command button on a form

                          Are you sure "pav5" + api_getenvironmentvar("usr") has the same structure as the table being appended from? Can you attach sample tables?
                          There can be only one.

                          Comment


                            #14
                            Re: differences between code command file and the code in a command button on a form

                            The two tables have a few fields of different structure. However, the code file works good when run the code ("v_wl") in the Control Panel or in the Interactive Window using script_play_local("v_wl"). But I got the following error when run the same code or using script_play_local("v_wl") on a form: Error running append operation Argument is incorrect data type.

                            Comment


                              #15
                              Re: differences between code command file and the code in a command button on a form

                              Thanks very much for your kindness.
                              The problem is solved by adding another function (u_sql2pav5f) that contains the SECOND append op and the following browse. i.e. The command button contains script_play_local("v_wl") and u_sql2pav5f("",1,1). I think there would be some bugs in A5 that may cause this problem.

                              Comment

                              Working...
                              X