Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy internal files

Status
Not open for further replies.

imox

Programmer
May 13, 2013
37
DE
Hello,

I can add files to my FoxPro projekt. It is possible to copy this files out of the projekt e.g. by using a form?

Thanks

p.s. sorry for my many questions but I'm new
 
Imox,

There is no need to apologise for your many questions. The forum wouldn't exist if people didn't ask questions.

However, I must again suggest that you need to clarify your question. It's not clear what you mean by "copy the files out of the project".

Do you mean you want to copy a file from one project to another?

Or do you mean you want to copy a file to another directory or drive?

Keep in mind that, when you add a file to a project, it still exists an independent file. You can still find it in its original folder, and you can still use all the Windows features to copy, move, paste, delete, rename, etc. If you are not sure of its name or location, highlight the file in the project manager, and the read path information at the bottom of the window.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks! I want copy a file from the project to another folder. Ok when all files are located in install directory then I have the files. But the install directory is always different. How can I get the current path? I hope it is clear ;)

 
I want get the current path programmatically
 
OK. Assume lcFile contains the name of the file. The following code will give you its path:

Code:
lcPath = JUSTPATH(FULLPATH(lcFile))

That will work if lcFile is in the default directory, or if it is in another directory and lcFile includes the directory.

Does that answer your question?

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I want copy a file from the project to another folder. Ok when all files are located in install directory then I have the files. But the install directory is always different.

My first question is what are you doing with the Project?
Are you using it to Compile/Build the various VFP Programs, Forms, etc. into an Executable (.EXE) ?

If so, then you don't need to worry about where the various Project parts reside since they will all be combined into the EXE file (no matter what directory they originally came from).

And when the EXE is put somewhere else for the users to access, the Path can be found by using Mike's suggestion above.

Good Luck,
JRB-Bldr



 
Code:
lcPath = JUSTPATH(FULLPATH(lcFile))

Sorry but what is lcFile? The local file in the directory in which is placed the program? I tried this and this doesnt work
 
The local file in the directory in which is placed the program?

What program? You were talking about files in a project. Then you asked about how to find the path of a file. Now you bring programs into it.

I suggest that, before posting a question, you think seriously about exactly what you want to know. Try to remember that we don't know anything about what you are working on, what your environment is, or anything else. The only information we have is what you are giving us. Try to ask your question in a way that gives us the information we need in order to help you.

After typing your question but before you hit the Submit button, you might find it helpful to leave the computer for a few minutes and do something else. When you come back, read your question back. Ask yourself if someone who doesn't know who you are or what you are doing would understand exactly what you are asking. If not, amend the question accordingly.

As I said at the start of this thread, I don't want to discourage you from asking questions. On the contrary. But it's very difficult for us to help you if we have to use the first half dozen replies to every thread in just trying to understand what you are asking.

Maybe some of the others here will have better luck in understanding this particular question. If so, I'll leave them to answer it. I hope you find a solution.

Mike






__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi,
Once you create your .APP or .EXE file you should no longer need the individual files unless you have specifically excluded them from the build. If you are talking about moving to a different computer for your development, then you should specify a PATH setting using, the SET PATH TO command. That way your project can always find your files and will update itself as needed. There is a thread from a couple of days ago that talks about Setting the path for a session.
To get the current path you would issue something like,
local lcpath
lcpath = set('path')
? lcpath
 
Keep in mind that, as we have said multiple times above, you do not the the Path to the Application's Program, Form, etc. files once you have compiled everything into an EXE.
Once that is done, all of the Applications 'pieces' are inside the EXE.

The only Paths you will need after that will be any Paths to 'external' files such as Data Tables, Destination Directories for reports, etc.

Since you indicate that the install directory is always different, you can either have a Configuration Data Table which can be configured by the user during the installation process (or later) to hold these 'external' directory references (the most flexible approach) or you can have the directories programatically determined.

Good Luck,
JRB-Bldr


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top