* * *

Author Topic: [SOLVED] Putting Clipbrd into Project Inspector  (Read 285 times)

Bazzao

  • Jr. Member
  • **
  • Posts: 99
  • Pies are squared.
[SOLVED] Putting Clipbrd into Project Inspector
« on: September 13, 2017, 02:07:03 am »
I am writing a simple program (I selected Program from new project) and need to use the clipboard, which I've used before in GUI applications.

But I get the following message at the uses clause:

Cannot find Clipbrd used by ... Check if package LCLBase is in the dependencies of the Project Inspector.

I went to Project Inspector and added "Lclbase.lpk" (not knowing if that is the correct file).

And it was not the correct file.

What do I add to solve it?

TIA

Bazza


« Last Edit: September 13, 2017, 08:22:31 am by Bazzao »
Bazza

Lazarus 1.6.4 r54278 FPC 3.0.2 x86_64-win64-win32/win64
Windows 10, 7.

PatBayford

  • Jr. Member
  • **
  • Posts: 71
Re: Putting Clipbrd into Project Inspector
« Reply #1 on: September 13, 2017, 02:43:39 am »
You need to make sure that you have LCLBase as a REQUIREMENT in the project inspector - that should make all of it's units available to your program. However, I'm not sure the Clipboard will be available in a console program, which is what the Program option produces.
Lazarus 1.6.4 FPC 3.0.2 SVN 54278 Windows 10 64bit

Bazzao

  • Jr. Member
  • **
  • Posts: 99
  • Pies are squared.
Re: Putting Clipbrd into Project Inspector
« Reply #2 on: September 13, 2017, 02:47:40 am »
Thanks PatBayford,

I right-clicked on required packages and added LCLBase from the list. Accepts that ok, so it seems Clipbrd is available (hopefully).

B
Bazza

Lazarus 1.6.4 r54278 FPC 3.0.2 x86_64-win64-win32/win64
Windows 10, 7.

Bazzao

  • Jr. Member
  • **
  • Posts: 99
  • Pies are squared.
Re: Putting Clipbrd into Project Inspector
« Reply #3 on: September 13, 2017, 03:13:52 am »
Yep, it does.

Interfaces needs to be added to Uses, and LCL to Project Inspector.

Works beautifully. I shall spend the rest of the day adding to the clipboard.  :D

Thanks

B

PS: BTW, I had to put in a try except to catch the "interfaces" error.
« Last Edit: September 13, 2017, 03:17:59 am by Bazzao »
Bazza

Lazarus 1.6.4 r54278 FPC 3.0.2 x86_64-win64-win32/win64
Windows 10, 7.

PatBayford

  • Jr. Member
  • **
  • Posts: 71
Re: Putting Clipbrd into Project Inspector
« Reply #4 on: September 13, 2017, 04:40:26 am »
Glad you got it working.  :D
Lazarus 1.6.4 FPC 3.0.2 SVN 54278 Windows 10 64bit

Bazzao

  • Jr. Member
  • **
  • Posts: 99
  • Pies are squared.
Re: Putting Clipbrd into Project Inspector
« Reply #5 on: September 13, 2017, 08:22:15 am »
So here is the solved procedure:

1) Open Project Inspector;
2) Right-click on Required Packages;
3) Add LCL;
4) Add LCLbase;
5) In the Program: Add Clipbrd to Uses;
6) Add interfaces to Uses;
7) Any error terminations, trap with

Code: Pascal  [Select]
  1.   try
  2.     (possible error code here)
  3.   except
  4.     on E: Exception do
  5.       writeln('ERROR: (your prompt here): ',E.Message);
  6.   end;
  7.  

B

Bazza

Lazarus 1.6.4 r54278 FPC 3.0.2 x86_64-win64-win32/win64
Windows 10, 7.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus