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

File to Clipboard for pasting file into other folder

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

  • File to Clipboard for pasting file into other folder

    I'm sure this has been asked before but I can't find it. Using Windows File Explorer, after navigating to the file you seek, you can select the file, right mouse click, and copy the file to the clipboard. This can be done with ui_get_file(). However, I am trying to reduce the user having to execute navigating and searching for files. I know of neither a way to get Alpha to show a single specific file in a folder having many files, nor of xbasic code to get a file to the clipboard making available the file to be pasted into a folder location of the users choice.

    I am somewhat left with having to have a temp folder used to copy specific files into, have ui_get_file() to open that temp folder which will have few files for the user to have to select from, have the user perform right mouse click and copy, and then delete the temp folder file selected. Not a bad option, but I though maybe there is something more direct.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  • #2
    Re: File to Clipboard for pasting file into other folder

    Sorry Mike, you've lost me somewhere.
    Do you know the file name before the search?
    Can you construct thefile name from data in Alpha?
    Are the file names constructed to relate to a record in AS?

    I had this problem with images. Needed to associate an image with a specific item.
    The item had a PK of, say 1234567+trailer+09 composed of vehicle, vehicle type,vehiclectype number
    The image had a filename of 1234567trailer09.jpg, in the Images folder.
    The file loookup was specific and went straight to the image file.

    Why are you wanting to copy the file location?
    Could you use a Hyperlink field?
    Ted Giles
    Example Consulting - UK
    .

    sigpichttp://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

    Comment


    • #3
      Re: File to Clipboard for pasting file into other folder

      Hi Ted,
      Yes the complete file path and file name is known. Example:
      ROOT FOLDER: C:\Art\Assets\Assets_repository\
      FILE: C:\Art\Assets\Assets_repository\AST.00013_Coors Light Giant Kickoff.AI

      With this, I would like foremost to be able to have this file copied directly to the the Clipboard to be able to paste the file the desktop. I see no method to do this directly with xbasic.
      Unable to get the file directly put to the Clipboard, I believe I have to open the file navigator and right mouse click on the file to get the file onto the Clipboard.
      I can use ui_get_file() to open the folder where the file is located, but the folder has 1000 files and navigating to the exact file is cumbersome. I don't see a way to get to the exact file using ui_get_file to have only that exact file presented to right click and copy it to the Clipboard. So

      1- Is there a method to directly get the file to the Clipboard without having to use ui_get file()....
      2. Is there a syntax/method to get ui_get_file() to present only the exact file and not the contents of all the files in the root folder and having to navigate to the file.

      And no, using file.copy() is not an option, because I am using the scenario of pasting to the desktop as an example. Where the file is to be pasted is dynamic, not predetermied, and will be the choice of the user at the moment.
      Last edited by Mike Wilson; 08-14-2019, 10:48 PM.
      Mike W
      __________________________
      "I rebel in at least small things to express to the world that I have not completely surrendered"

      Comment


      • #4
        Re: File to Clipboard for pasting file into other folder

        I am probably being a bit thick here, but when you say "the file", what do you need to do with it?
        Do you want the whole file to go into a Memo Field, to create a link so that if the user can click and display the file content or what?
        Copying it would mean 2 versions of the file, so is that what you are after?

        EDIT
        What about Clipboard.Set_Data() ?
        Then, you could test for the presence of the file using File.Exists()

        So, a message if there is no file to find, or a Clipboard path with the file created in it as you have the construction already?
        Last edited by Ted Giles; 08-15-2019, 04:26 AM.
        Ted Giles
        Example Consulting - UK
        .

        sigpichttp://ec12.example-software.com//
        See our site for Alpha Support, Conversion and Upgrade.

        Comment


        • #5
          Re: File to Clipboard for pasting file into other folder

          I know of no way to copy a file unless the location is known. However, you can filter the ui_get_file() with:
          dim prmpt_default as c
          dim prmpt_title as c
          dim prmpt_filter as c
          dim prmpt_flag as c
          dim vFileName as c
          prmpt_default = "C:\Art\Assets\Assets_repository"+chr(92)
          vFileName = "AST.00013_Coors Light Giant Kickoff"
          prmpt_title = "Select file"
          prmpt_filter = "all("+ vFileName +"*.*)"
          vscan_list = ui_get_file(a5_eval_expression(prmpt_title),prmpt_filter,prmpt_default)

          Comment


          • #6
            Re: File to Clipboard for pasting file into other folder

            Mike, it seems to me that it might be possible to:
            - use File methods to write the file to a blob variable
            - use the ui_browse_for_folder function to enable the user to select the destination
            - prompt the user for a new filename, possibly suggesting a default
            - use File or Blob methods to create the new file from the variable

            In other words you might not have to use clipboard at all.

            Comment


            • #7
              Re: File to Clipboard for pasting file into other folder

              And no, using file.copy() is not an option, because I am using the scenario of pasting to the desktop as an example. Where the file is to be pasted is dynamic, not predetermied, and will be the choice of the user at the moment.
              But, if you allow the user to select the file, then you would have the filename assigned to a variable already. If you assign a new variable to the stripped filename with the new path, then it should just be file.copy(orig_filename, new_filename).

              Am I missing something?

              Tom

              Comment


              • #8
                Re: File to Clipboard for pasting file into other folder

                Hi all,
                Our users access our application on our network via RDP. When in the application, if a user navigates to a file and then uses right click and copies the file, the file is on the clipboard. Then the user navigates/toggles to their personal computer desktop or any place in their personal computer off the network, then they can right click and paste the file to the place they want the file to be copied to in a location off the network in their personal computer. I don't know how to have it for alpha on the network to direct the file copy to a location off the network. Using the clipboard is the only way I know of to make that happen between the different spaces. The address of C:\transfer when on the network will not copy the file to c:\transfer on the users personal computer.
                Mike W
                __________________________
                "I rebel in at least small things to express to the world that I have not completely surrendered"

                Comment


                • #9
                  Re: File to Clipboard for pasting file into other folder

                  Are the local computers visible as shared resources on the server? If the local machines were to be set up to share "C:\Transfer" as "AlphaTransfer" with "everyone" then that folder could, theoretically, be read by Alpha from the server. The IT people might not like that idea. You'd need to get the logged-in machine name for each user on the server. That was pretty easy up through Server 2012-R2 (you can run a batch file from Alpha with just the "SET" command - redirect the command output to a file, then parse the file for the "CLIENTNAME" value) but I don't know how you would do it for later server versions. (I don't think Alpha has a method for this.)

                  If that can be done then you could, again theoretically, use network addressing in a file.copy() command. Something like (don't trust my syntax!)
                  infile = "\\ServerName\FolderWithFile\filename"
                  outfile = "\\LocalMachineName\AlphaTransfer\filename"
                  file.copy(infile,outfile)

                  Might be worth a try.
                  Finian

                  Comment


                  • #10
                    Re: File to Clipboard for pasting file into other folder

                    Hi Finian,
                    Hum... Something to think about, and look into, for sure. Thank you.
                    Mike W
                    __________________________
                    "I rebel in at least small things to express to the world that I have not completely surrendered"

                    Comment


                    • #11
                      Re: File to Clipboard for pasting file into other folder

                      Hi Mike,
                      Did you ever get this to work?
                      Robin

                      Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                      Comment


                      • #12
                        Re: File to Clipboard for pasting file into other folder

                        No I haven't. Still working on it. Will report back if and when I get some conclusions.
                        Mike W
                        __________________________
                        "I rebel in at least small things to express to the world that I have not completely surrendered"

                        Comment

                        Working...
                        X