User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Pascal and Delphi section within the Software Development category of DaniWeb, a massive community of 456,539 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,245 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Pascal and Delphi advertiser: Programming Forums
Views: 1577 | Replies: 1
Reply
Join Date: Oct 2007
Posts: 2
Reputation: jglochhead is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jglochhead jglochhead is offline Offline
Newbie Poster

CopyFile() & Tree View Problems

  #1  
Oct 12th, 2007
Hi everyone,

As the title says I am have two problems:

1) I want to copy a template database (.dbf) and name it based upon user input into an edit box, however, I am getting an error when I try to compile my code saying that the PChat type is incompatible with the String type. Is there any way I can solve this? The example code can be found below.

{There is an edit box on the form called EditBox1 and a button called Button1. The template database is called template.dbf and is in the databases directly. I wish to copy the new file to the same directory.}

procedure TForm1.Button1Click(Sender: TObject);
var getname : String;
begin
getname := concat('databases\',Edit1.Text,'.dbf');
CopyFile('races2.dbf',getname,true);
end;

2) Secondly I would like to obtain the string value of the currently selected item of a Win32 Tree View. I do not have any code to illustrate my problem so I have used a similar item (a combo box) to show you what I would like to do.

{There is a combo box on the form called ComboBox1 and a button called Button1.} 

procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(ComboBox1.Text);
end;

Basically what I am asking is how would I use the above code with a Win32 Tree View rather than a Combo Box?

Thanks in advance
Last edited by jglochhead : Oct 12th, 2007 at 11:30 am.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Posts: 2
Reputation: jglochhead is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jglochhead jglochhead is offline Offline
Newbie Poster

Re: CopyFile() & Tree View Problems

  #2  
Oct 17th, 2007
Never mind found it out by myself. I needed to use PChar() on the String and do a TreeView1.Selected.Text;
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Pascal and Delphi Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Pascal and Delphi Forum

All times are GMT -4. The time now is 4:55 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC