Clipboard to Text File

I'm tired, but need this answer when I arrrive at work tomorrow AM... Would anyone please be willing to help me out with this one?

I have a memo field a DBMemo component and want to copy it to the clipboard (DMBemo1.CopyToClipboard).  No problem.

Now I want to create a temporary text file called, say, C:\BIND.TXT.  The contents of BIND.TXT should be the contents of the DBMemo field.  Any easy way to create the text file and pump the contents of the clipboard in?

Thanks in advance,
WKHays
LVL 4
wkhaysAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rwilson032697Commented:
Do it like this (without the clipboard)

DBMemo1.Lines.savetofile('c:\bind.txt');

Cheers,

Raymond.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
edeyCommented:
If you really need to get it from the clipboard you have a couple of options:

1)You could paste the clipboard data into a memo/richEdit and then save, or

2)call the TClipboard.getTextBuf method and write the data to a file yourself.

GetTextBuf retrieves the control's text and copies it to a buffer.

function GetTextBuf(Buffer: PChar; BufSize: Integer): Integer;

Description

Use GetTextBuf to retrieve text from a control and copy it into the buffer pointed to by Buffer. GetTextBuf copies up to the number of characters given by BufSize, and returns the number of characters copied.
The resulting text in Buffer is a null-terminated string.
To find out how many characters the buffer needs to hold the entire text call the GetTextLen method before calling GetTextBuf.



GL
Mike
0
wkhaysAuthor Commented:
Cheers, rwilson.  Simple and to the point - I learn this stuff as I go along.  Thanks for your comment as well, Mike.

WKHays
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.