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

script copying to clipboard problems

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

    script copying to clipboard problems

    Have a set, parent is Inv_hedr than there are multiple 1 to many links back to the Clients table. The link that I can't get the script to work has the alias Bill_to.
    Getting the following error message:inv_error.png[ATTACH=CONFIG[30576[/ATTACH]


    Using this code, originally from Alpha sports. I have modified it and do have it working in other forms. Some how I am not addressing the right object or field names.
    Code:
    'Date Created: 20-Jan-2012 11:33:44 AM
    'Last Updated: 20-Jan-2012 11:48:12 AM
    'Created By  : Barry
    'Updated By  : Barry
    t=table.current()
    dim address as c
    crlf = chr(13)+chr(10)
    address = trim(t.firstname)+ " "+trim(t.lastname)+crlf
    address = address + t.address1+crlf
    IF .not. t.address2.is_blank()
    	address = address+t.address2+crlf
    END IF
    address = address + trim(t.city) +", "+trim(t.state)+ " " +t.zipcode
    :clipboard.set_data(address)
    Attached Files

    #2
    Re: script copying to clipboard problems

    table.current() refers to the parent table of a set when used in a set context.

    See this thread for a discussion of referring to child tables.
    There can be only one.

    Comment


      #3
      Re: script copying to clipboard problems

      Stan,

      I am also using the same code with the same form with the ship_to alias (see the ship to image in the above post) without any problems.

      Code:
      t=table.current()
      dim address as c
      crlf = chr(13)+chr(10)
      address = trim(t.ship_first)+ " "+trim(t.ship_last)+crlf
      address = address + t.ship_line1+crlf
      IF .not. t.ship_line2.is_blank()
      	address = address+t.ship_line2+crlf
      END IF
      address = address + trim(t.ship_city) +", "+trim(t.ship_state)+ " " +t.ship_zip
      :clipboard.set_data(address)
      If I change the slot number to 2 or 3 (not sure how to determine the slot number) I get an error message on the First and last name fields also which I previously did not get.
      inv_set.png

      Comment


        #4
        Re: script copying to clipboard problems

        Not sure what is unclear in the documentation about slot positions.
        Attached Files
        There can be only one.

        Comment


          #5
          Re: script copying to clipboard problems

          That fixed it.
          Still don't understand why the ship_to, clipboard code works without a slot number.

          Comment


            #6
            Re: script copying to clipboard problems

            For edification, yours and mine, try the ship to code with the proper slot number and let us know what happens.
            There can be only one.

            Comment


              #7
              Re: script copying to clipboard problems

              No good, it stoped woking when I placed #5 into the tablecurrent expression.
              inv_error_slot.png

              Comment


                #8
                Re: script copying to clipboard problems

                I am now trying to use this code on another form With the data that is in slot 3 and it works. However I have 1 field "Ses_id" that is at the parent level. Since the script starts with table t=table.current(3) how do I code the field from the parent?

                Comment


                  #9
                  Re: script copying to clipboard problems

                  Use another pointer.

                  t1=table.current(1)
                  There can be only one.

                  Comment


                    #10
                    Re: script copying to clipboard problems

                    in your script "t" is simply a pointer to one of the tables supporting your form.

                    Your script is not limited to a single pointer. So, you could get a pointer to the parent table like this:

                    t_parent = table.current()

                    and then reference the desired field like this

                    t_parent.ses_id


                    -- tom

                    Comment


                      #11
                      Re: script copying to clipboard problems

                      Wouldn't table.get() completely solve this problem?
                      Mike W
                      __________________________
                      "I rebel in at least small things to express to the world that I have not completely surrendered"

                      Comment


                        #12
                        Re: script copying to clipboard problems

                        Got it.
                        Thanks

                        Comment


                          #13
                          Re: script copying to clipboard problems

                          Barry, for the benefit of others who visit this thread in the future please take a few minutes and tell us what "it" means. While its nice to know your problem has been solved, being able to see the solution helps the message board become a knowledge base for others.

                          Comment


                            #14
                            Re: script copying to clipboard problems

                            Followed the above recommendations, and added another table current pointer.
                            Code:
                            t1=table.current()
                            t=table.current(3)
                            dim address as c
                            crlf = chr(13)+chr(10)
                            address = alltrim(str(t1.ses_id,7,0))+crlf
                            address = address + trim(t.firstname)+ " "+alltrim(t.lastname)+crlf
                            address = address + t.address1+crlf
                            IF .not. t.address2.is_blank()
                            	address = address+t.address2+crlf
                            END IF
                            address = address + trim(t.city) +", "+trim(t.state)+ " " +t.zipcode
                            :clipboard.set_data(address)

                            Comment


                              #15
                              Re: script copying to clipboard problems

                              Barry,
                              Why is there a chr(13) in your crlf variable? Why not just use crlf()?

                              It has been recommended on this board that table.get() is a better method and a separate pointer for each table that makes sense to you be used. When you are dealing with 2-3 tables in a script, using a convention that makes it easier for you to remember what the pointer-table assignments are makes it easier with fewer mistakes. It has been suggested recently on this board that a three letter pointer convention should be a minimum within complex scripts. I don't know why everyone uses tbl. as a table pointer. I've been using a convention of using table.get() and for the pointer "t" and the first two letters of the table name if the script has more than one table pointer. Yes, tables can have similar names and this breaks down, so then it is another letter in the name that generates identification, but that's rare. It makes it alot easier than trying to remember "Is this table I'm dealing with in this line of code table 1 vs table 2" .... how did I assign those?... etc.
                              Mike W
                              __________________________
                              "I rebel in at least small things to express to the world that I have not completely surrendered"

                              Comment

                              Working...
                              X