Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: Compile/Convert Delphi project to MacOS
« Last post by Martin_fr on Today at 05:43:11 pm »
Should I manually add Interfaces?

Its worth a try. And check that "Application" is "Run" as in my example, and the form is created.

Also "{$APPTYPE CONSOLE}" seems wrong (but may still work).  Well => that is, your app has forms?

Mind, that my answer is partly guessed... I mainly work on other parts of Lazarus...
2
General / Re: Generics - correct syntax
« Last post by Thaddy on Today at 05:40:59 pm »
Did you actually read the documentation? Because the differences are well documented.
I smell a bit of too lazy to read...
It is chapter 8 of the programmers reference guide... >:D
3
Operating Systems / Re: Unlocking Files
« Last post by Redenegue on Today at 05:35:46 pm »
I have used 2 methods of renaming.
Usually they work good.
However sometimes when I go down a list of files, one or more of them will not rename.
I open Windows explorer, make a little change in the filename, and then my program will rename them.
So, it is in a list of files.
This happens in a situation where I never opened them.
But if I did accidentally open them, only a rare file, in a list, is affected, none of the others.
I am also curious why my function at the bottom will not rename files with foreign characters.
I thought it might work better than FileRename.
If they seem a little "wordy", its to make them easier to debug.
Also, there is no problem with the new file names. I checked that out carefully.
My renamed files get rid of questionable and junk characters, simplifies the name and gives them some common structure.

BTW, You have been kind to me. I appreciate that. I am old now, sometimes things get past me.
I have a few things to finish up while I can. I miss the old days when a hacker was a good guy.
Thank the ignorant media for that one. It was Phreakers who did the bad "hacking".
They never said a word about them. They turned a whole generation of us into criminals.

// Rename 1
TShellTreeView OnChange:
ActiveDir := IncludeTrailingPathDelimiter(STV1.Path); 

OnClickEvent:
     For I := 0 to ActiveList.Items.Count - 1 do
     begin
          If ActiveList.Items.Item.Selected then
          begin
               FN := ActiveList.Items.Item.Caption;
               NFN := FN;

// File Name altered here

               RenameFile(ActiveDir + FN, ActiveDir + NFN);
          end;
     end;

// Rename2
     I := 0;
     While I < Selected.FileList.Items.Count do
     begin
          If Selected.FileList.Items.Item.Selected then
          begin
               C := Selected.FileList.Items.Item.Caption;
               If MoveAFile(FileIn, FileOut) then
               Selected.FileList.Items.Item.Caption := C;

// This function will not rename files with foreign characters
Function TWork.MoveAFile(StrFrom, StrTo: string): Boolean;
var
  F : TShFileOpStruct;
begin
  F.wFunc:=FO_MOVE;
  F.pFrom:=PChar(StrFrom+#0);
  F.pTo:=PChar(StrTo+#0);
  F.fFlags := FOF_RENAMEONCOLLISION or FOF_NOCONFIRMMKDIR or FOF_NOCONFIRMATION or FOF_SILENT;

  if ShFileOperation(F) <> 0 then
    result:=False
  else
    result:=True;
end;               



4
General / Re: Parameter passing oddities
« Last post by Thaddy on Today at 05:35:41 pm »
Those vars hurt my eyes. You have to present it better and with a proper use case.
And with a language example in a different language. I am sure fpc already has a way of expressing that. (without the in this case code mutilating var)
5
Windows / Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Last post by msintle on Today at 05:32:42 pm »
I've also launched this job at Upwork:

https://www.upwork.com/jobs/~017b8f1ec5e0058846

As an interim solution to figuring out where the right bounty is to be offered.
6
Third party / Re: InstallAware Using Lazarus IDE
« Last post by msintle on Today at 05:26:36 pm »
I've posted a conversion job for this at Upwork, to see if anyone better qualified than me might be up for a quick buck:

www.upwork.com/jobs/~01bba81ac1e6b6bca5

Happy to render the bounty as payment on other platforms of your choosing, too.
7
General / Re: Parameter passing oddities
« Last post by Nitorami on Today at 05:24:55 pm »
Well, I could produce a shitload of overloaded versions including their respective operators. Not sure if I want that, it requires either to duplicate the code or mutual calls with intermediate tmp version. Like this

Code: Pascal  [Select][+][-]
  1. (A)
  2. procedure add (const a,b: complex; out c: complex); overload;
  3. begin
  4.   c.re := a.re+b.re;
  5.   c.im := a.im+b.im;
  6. end;
  7.  
  8. (B1)
  9. procedure add (var a: complex; const b: complex); overload; //effectively duplicating the above version
  10. begin
  11.   a.re := a.re+b.re;
  12.   a.im := a.im+b.im;
  13. end;
  14.  
  15. (B2, Alternative)
  16. procedure add (var a: complex; const b: complex); overload; //no duplicating but requiring a tmp var
  17. var tmp: complex;
  18. begin
  19.   tmp.re := a.re; //make a copy avoiding tmp := a
  20.   tmp.im := a.im;
  21.   add (tmp,b,a);
  22. end;

But all that would not be necessary if there was a method of passing parameters which works like const but avoids the "constant" assumption. I don't know how other languages handle this. Just feel something is missing in Pascal.
8
General / Re: Compile/Convert Delphi project to MacOS
« Last post by Joseph on Today at 05:23:15 pm »
in Project Source I have:

Code: Pascal  [Select][+][-]
  1. program lifelihoodC2023;
  2.  
  3. {$MODE Delphi}
  4.  
  5. {$APPTYPE CONSOLE}
  6.  
  7. uses
  8.   SysUtils,
  9.   Classes,
  10.   Unit2 in 'Unit2.pas',
  11.   Alea in 'Alea.pas',
  12.   fmath in 'fmath.pas',
  13.   fspec in 'fspec.pas',
  14.   mathromb in 'mathromb.pas',
  15.   Unit1 in 'Unit1.pas';
  16.  
  17. begin
  18.      

Should I manually add Interfaces?

Current LCL widgetset: "cocoa"
--> seems right
9
General / Re: Parameter passing oddities
« Last post by Thaddy on Today at 05:19:18 pm »
Quote
BUT - Ah!- the assertion fails on "add (C1,C2,C1)" or "C1 := C1+C2". Yes, I see. Of course it does. But I need such calls.
You can define an overload, e.g.
Code: Pascal  [Select][+][-]
  1. procedure Add (var a: complex; const b: complex); overload; inline;
  2. begin
  3.   {a += b }
  4. end;
(or whatever order of parameters suits you)
Although this is possible I would never use a var parameter, since part of your code may rely on a known value and var will change that value globally..... Not recommended.
10
Windows / Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Last post by msintle on Today at 05:17:40 pm »
Not that for most (existing) developers money isn't a motivation. It has more to do with interest and schedule. Most developers have heaps of work in front of them already and although money is able to change/influence priorities most do not care about that.

Correct. I don't care about bounties. If I don't have the motivation/time to work on something I don't have the motivation/time and that is simply not up for discussion. I work on FPC, because I want and not because someone else wants me to work on it.

+1

Do you have any ideas on how to reach people who are both competent in FPC and excited about the aarch64 Windows transition?
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018