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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding a file to another folder using checkbox logical condition and buttons

Status
Not open for further replies.

ninjaman01

Programmer
Aug 11, 2021
14
PH
Hi everyone can someone help me with my problem on how to add a file from another folder wherein when the checkbox is true it will add the file to a folder when the command button is click and it will check the folder if it has existing file. I'm sorry if this is very confusing I'm new on using foxpro.
 
Welcome to the forum. Yes, your message is rather confusing (but not because you are new to FoxPro).

However, I will try to make sense of it.

First, "add a file from another folder". Do you mean you want to copy a file from one folder to another? If so, there is the COPY FILE command. It's very simple. For example: [tt]COPY c:\Data\MyFile.txt TO c:\BackData\MyFile.txt[/tt]. The file cannot be open at the time.

"When the checkbox is true": You can test whether a checkbox is true by testing its Value property. If the Value is either .T. or 1, the checkbox is "true".

"When the command button is click": You need to write your code in the Click event of the command button. Whatever code you put there will be executed when the user clicks the button.

"Check the folder if it has existing file": The FILE() function can check for the existence of a file in a given folder. For example: [tt]FILE("c:\BackData\MyFile.txt")[/tt] returns .T. if MyFile.txt exists in c:\BackData.

Does that answer your question? If not, please try to rewrite your question more clearly. And then read it back to yourself to check that it makes sense, keeping in mind that we don't know anything about the context.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hello Ninjaman01,

I tried to answer your question a week ago, but haven't heard back from you. Was my reply useful? Or did I misunderstand what you were asking? It would be useful to know.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Sir sorry for my late reply, I already solve the issue, your answer is very useful. Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top