Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
macOS / Mac OS X / Re: ld: library not found for -lc
« Last post by trev on Today at 10:34:24 pm »
I recently had a similar issue after upgrading Xcode on both an M1 Mac mini and an Intel Mac mini. The solution was the following:

1) open Xcode which may say it needs to install additional components, let it do so.
2) execute xcodebuild -runFirstLaunch in a Terminal
3) execute xcode-select --install
4) success

My symptoms that all was not well (a script-driven download of FPC + Lazarus development source using git was failing) were:

1) having git crash when trying to use it!
2) being told to execute xcode-select --install
3) xcode-select --install downloading and installing the CLI
4) cycling back to 1)

All very weird.
2
TAChart / Re: ChartPane caption
« Last post by wp on Today at 10:15:36 pm »
Sorry. Here it is...
3
General / TFpgMap.onDataCompare problem
« Last post by Frogfather on Today at 09:54:11 pm »
Hello,

I'm experimenting with sorting a string->int map by data value using the onDataCompare function.

So I have defined my map:
TStringIntMap = specialize TFPGMap<String,Integer>;

In the class I want to use this I have

TSomeClass = class
private
fMap:TStringIntMap;
function compare(const d1,d2:integer):integer; 
public
constructor create;
end;

and in the constructor I have

constructor create
begin
fMap:=TStringIntMap.create;
fMap..OnDataCompare:=@compare;
end;

this looks pretty similar to the example but fails to compile with the error

Incompatible type for arg no. 1: Got "<procedure variable type of function(const LongInt;const LongInt):LongInt of object;Register>", expected "TFPGMap$2$crc3DEDFEAF.<procedure variable type of function(const LongInt;const LongInt):LongInt;Register>"

and I'm not sure what that means. What is the difference between 'LongInt of object;Register' and 'LongInt;Register' ?

Anyway - if anyone has any suggestions I'd be most grateful.

Cheers
John
4
TAChart / Re: ChartPane caption
« Last post by kapibara on Today at 09:44:45 pm »
Demo was not attached?

Yes, captions are important so it's probably better to use individual charts and TChartExtentLink for this. Although when using a crosshair, it will not extend into upper and lower panes as it does with a single chart, but that can be overcome.

I did a "git pull" of the latest trunk and your changes of TAChartExtentLink is ready available.
5
macOS / Mac OS X / Re: ld: library not found for -lc
« Last post by Jonas Maebe on Today at 09:27:27 pm »
That means the command line tools are not installed, regardless of what xcode-select is telling you. You'll have to manually download the from https://developer.apple.com/download/all/?q=command%20line%20tools%20for%20Xcode and install them that way.
6
General / Re: Throw error if string is empty
« Last post by nikel on Today at 09:06:03 pm »
I tried it one more time and it worked:

Code: Pascal  [Select][+][-]
  1. try
  2.   WriteLn(Length(BpmPtr^) / Length(BpmPtr^));
  3. except
  4.   on E: Exception do
  5.   begin
  6.     raise Exception.Create('bpm tag not found. ' + #13#10 + E.Message);
  7.     GetAllTagsByPathUnset;
  8.     Halt(-1);
  9.   end;
  10. end;

Thanks for the replies.
7
Third party / Re: Search panel plugin for the Lazarus IDE
« Last post by theo on Today at 08:38:05 pm »
theo, could you please check the box "Maximize compatibility of package file (LPK)" in the package options. This way users of older Lazarus versions will be able to install the package, too.
OK, done.
8
Third party / Re: Search panel plugin for the Lazarus IDE
« Last post by wp on Today at 08:05:58 pm »
Hello Curt
This looks great, but I'm having trouble getting it installed.  I'm using Linux, Lazarus 2.0.8 with anchordocking and FPC 3.0.4.  Any guidance would be appreciated.
It would recommend you to update your Lazarus version.
Your version is from April 2020.
Just tried to install the package in to v2.0.8 on Windows, and it did install und runs fine. There is one issue, though: After v2.0.x, the file format for package files was changed, and the package is stored in the new format. theo, could you please check the box "Maximize compatibility of package file (LPK)" in the package options. This way users of older Lazarus versions will be able to install the package, too. Earlier versions than 2.0 cannot compile the package due to the usage of ImageLists in BitBtn/SpeedBtn.
9
General / Re: Populate Treeview from Table
« Last post by cdbc on Today at 07:42:56 pm »
Hi
I use something like this:
Code: Pascal  [Select][+][-]
  1. function bcGetNodeWithParentByTextAtLevel(aTree: TTreeView;
  2.                                           aParent: TTreeNode;
  3.                                           const aValue: string;
  4.                                           aVisible: boolean;
  5.                                           aLevel: integer): TTreeNode;
  6. var
  7.   Node: TTreeNode;
  8. begin
  9.   Result:= nil;
  10.   if aTree.Items.Count = 0 then exit; { nothing to do }
  11.   Node:= aTree.Items[0]; { ie.: root-node }
  12.   while Node <> nil do begin
  13.     if ((UpperCase(Node.Text) = UpperCase(aValue)) and
  14.        (Node.Level = aLevel) and (Node.Parent = aParent)) then begin
  15.       Result:= Node;
  16.       if aVisible then Result.MakeVisible;
  17.       break;
  18.     end;
  19.     Node:= Node.GetNext;
  20.   end;
  21. end; { bcGetNodeWithParentByTextAtLevel }
  22.  
and use it like this:
Code: Pascal  [Select][+][-]
  1. WeekNode:= bcGetNodeWithParentByTextAtLevel(trvNav,YearNode,anItem.Date.WeekNumberAsString,false,2);
  2.     if WeekNode <> nil then begin
  3.       // do stuff
  4.     end;
  5.  
HTH
Regards Benny
10
Third party / Re: Search panel plugin for the Lazarus IDE
« Last post by theo on Today at 07:42:21 pm »
Hello Curt
This looks great, but I'm having trouble getting it installed.  I'm using Linux, Lazarus 2.0.8 with anchordocking and FPC 3.0.4.  Any guidance would be appreciated.
It would recommend you to update your Lazarus version.
Your version is from April 2020.

https://sourceforge.net/projects/lazarus/files/
Or using fpcupdeluxe:
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/tag/v2.2.0n

Then simply follow these steps:
https://wiki.lazarus.freepascal.org/Install_Packages#Adding_new_packages
There is nothing special about it.
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018