-
Content Count
24 -
Joined
-
Last visited
Posts posted by zed
-
-
On 1/18/2024 at 2:38 PM, softtouch said:I got most things running already and even it has no regex, gmatch and some other will do it.
You can provide your own functions to work with regex in lua. Its API is very flexible.
Look at this for example: https://www.geek.co.il/~mooffie/mc-lua/docs/html/modules/regex.html (the implementation is quite simple: regex.c)
-
12 hours ago, ginnix said:How long has it been down now?
I just noticed it two days ago, still down for me.
- 2
-
And here we go again!
- 1
-
-
Here is the answer:
-
It's hard to understand what exactly you want. How about this:
if (X in [0..7]) and (Y in [0..7]) then begin ... end
-
-
No, I mean what should I do in my Test.exe to make it possible to load translations from some subfolder? I don't like idea to keep this files in the application root folder.
-
Is possible to keep translations in sub folder?
.\Test\Test.exe .\Test\lang\Test.fr-FR .\Test\lang\Test.de-DE
-
+1 for dxgettext, works like a charm!
-
There are Delphi wrappers for libcurl (for example: mormot2), so you can easily port your existing C code to Delphi.
-
Start of the next day is the end of the current day, so you can write:
var a, b: TDateTime; begin a := StrToDateTime('17:30'); b := StrToDateTime('00:00') + 1; // 24:00 WriteLn(MinutesBetween(b, a)); // 390
-
In Delphi 11 they changes default font to "Segoe UI".
-
-
-
Delphi 11.1 also changes the Form font size:
- PixelsPerInch = 96 - TextHeight = 13 + TextHeight = 15
-
-
@vfbb How about using a lock? Try this fix:
diff --git a/Unit1.pas b/Unit1.pas index e0d57a2..a27eef0 100644 --- a/Unit1.pas +++ b/Unit1.pas @@ -6,7 +6,7 @@ interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, System.Threading, - FMX.Controls.Presentation, FMX.StdCtrls; + FMX.Controls.Presentation, FMX.StdCtrls, System.SyncObjs; type ITest = interface @@ -38,6 +38,7 @@ type FThreadsPool: TArray<TThreadPool>; FTest: ITest; FTestWeak: TArray<TWeakOfTest>; + FLock: TCriticalSection; public { Public declarations } end; @@ -54,6 +55,7 @@ implementation procedure TForm1.FormCreate(Sender: TObject); begin + FLock := TCriticalSection.Create; FTestControlThreadPool := TThreadPool.Create; FTestControlTask := TTask.Run( procedure() @@ -85,17 +87,32 @@ begin begin while (not FDestroying) and (not FCanceled) do begin - LTest := Form1.FTestWeak[(Length(Form1.FTestWeak) div 2)-1].FTestWeak; // Use a weak reference that is in the middle of the list of weak references + FLock.Acquire; + try + LTest := Form1.FTestWeak[(Length(Form1.FTestWeak) div 2)-1].FTestWeak; // Use a weak reference that is in the middle of the list of weak references + finally + FLock.Release; + end; if Assigned(LTest) then // Test if the strong reference is valid, that is, theoretically verify that the object has not yet been destroyed begin LTest.Test; // Just a useless call, because if the reference still exists and the object has been destroyed, this will give an exception - LTest := nil; // Removing the strong reference + FLock.Acquire; + try + LTest := nil; // Removing the strong reference + finally + FLock.Release; + end; end; end; end, Form1.FThreadsPool[I]); end; Sleep((Random(20) + 3) * 500); // Wait all tasks run many AddRef / Release simulating a stress test - Form1.FTest := nil; // Remove the strong ref to force the object destruction (Note: we don't know what task will destroy, will be the last that remove the strong ref) + FLock.Acquire; + try + Form1.FTest := nil; // Remove the strong ref to force the object destruction (Note: we don't know what task will destroy, will be the last that remove the strong ref) + finally + FLock.Release; + end; Sleep((Random(10) + 1) * 200); // Wait some seconds to ensure the object destruction // Cancel the test, check if have error, free all objects and get ready to repeat the next test loop @@ -137,6 +154,7 @@ begin FTestControlTask.Wait; FTestControlTask := nil; FTestControlThreadPool.Free; + FLock.Free; end; { TTest }
To protect your data you need to use a lock every time you assign value to the LTest and Form1.FTest.
-
3 hours ago, zed said:License extension is broken at the moment. I have reported the problem to Embarcadero (thanks Cathy Hundley), so it remains to wait while they fix the bug.
By the way, exactly the same problem with license extending was a year ago...
@Oberon82 I have just been informed that the problem has been fixed and you can request the key as usual: https://www.embarcadero.com/products/delphi/starter/free-download/
- 2
-
2 minutes ago, emailx45 said:and try use new license....
And how do you propose to get a new license?
-
License extension is broken at the moment. I have reported the problem to Embarcadero (thanks Cathy Hundley), so it remains to wait while they fix the bug.
By the way, exactly the same problem with license extending was a year ago...
DelphiLint v1.0.0 released!
in Delphi Third-Party
Posted · Edited by zed
https://github.com/integrated-application-development/delphilint/releases/tag/v1.0.1