-
Content Count
583 -
Joined
-
Last visited
-
Days Won
6
Posts posted by Vandrovnik
-
-
It is a feature, not a bug 🙂 (I have never seen it before.)
Â
https://docwiki.embarcadero.com/RADStudio/Sydney/en/W1013_Constant_0_converted_to_NIL_(Delphi)
Â
-
11 minutes ago, Lajos Juhász said:Â
I never saw this kind of code, I saw:
Â
if Assigned(obj) then
 obj.free;
Most of the time I only saw that a "developer" refuses to use free instead of FreeAndNil.Â
Â
I also use FreeAndNil - if I ever forget that an object was already freed with .Free, app might be working fine or give an AV "sometimes". When I use FreeAndNil and by mistake try to use freed object later, I am sure it always gives AV. I would not use FreeAndNil in time-critical parts, but there are almost none in my apps.
-
1
-
-
13 hours ago, Anders Melander said:Nice. I believe you can just use the FindDragTarget VCL function to find the control under the cursor.
Â
The current algorithm looks for an exact match on the control name and then iterates backward (i.e. negative row index increment) from the least property until it finds a visible property. It does not consider the Status of the property since it doesn't know what you're doing or why you want to select the item. I'd like to keep it that way.
If you filter the Status column to exclude "Don't translate" then these properties will not be selected and it will behave like you want. Since you're not interested in the "Don't translate" items anyway there's no point in displaying them.Thank you, I did not realize that it is possible to use a filter 🙂 That will be enough.
-
On 3/6/2022 at 10:10 PM, Anders Melander said:Now there are 🙂 Do something like this:
// Via TApplicationEvents component: procedure TMainForm.ApplicationEventsActionExecute(Action: TBasicAction; var Handled: Boolean); begin {$ifdef DEBUG} TranslationManagerIntegration.TrackControl(Action); {$endif DEBUG} end; ...
Note: Remove the DEVEXPRESS define in Horizon.IntegrationTest.API if you're not using that library.
As you can see the above only uses the integration in DEBUG builds but since I'm just using WM_COPYDATA for communication it's pretty harmless if the integration is also active in RELEASE builds.
Â
It works, that is really great!
Â
I have also add a Ctrl + right-mouse-click to find labels etc.:
procedure TdmMain.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean); var PointClient: tPoint; Control: tControl; Form: tWinControl; begin {$IFDEF PrekladyBTM} if (msg.message=WM_RBUTTONDOWN) and ((msg.wParam and MK_CONTROL) <> 0) then begin Handled:=true; Form:=Screen.ActiveCustomForm; if Form<>nil then begin PointClient:=Form.ScreenToClient(Mouse.CursorPos); Control:=Form.ControlAtPos(PointClient, true, true, true); if Control<>nil then TranslationManagerIntegration.TrackControl(Control); end; end; {$ENDIF} end;
Â
Just a small notice: when I need to find a control and there are more properties in BTM, BTM often selects a property with "Don't translate". Please could you change it, so that BTM tries to select a property which should be translated?
Â
-
8 minutes ago, Juan C.Cilleruelo said:Firebird doesn't work as an embedded version on Mac OS X. Â
Â
I have never tried, but it seems it should work, at least for FB 2.5 they explicitly write about embedded version:
-
Could you use Firebird for the free version? With server, or even embedded, so there is no need to install it.
-
1
-
-
20 minutes ago, AlanScottAgain said:
But then its an untyped list?
I guess that may be the way to goNo, it is just a forward declaration.
-
Just put this to the top:
Â
type tDrawingObjectList = class;
-
If you have SynEdit from GetIt, then yes, you may get newer version of SynEdit after installing newer Delphi.
SynHighlighterMulti.pas is on C:\Users\MyUserName\Documents\Embarcadero\Studio\22.0\CatalogRepository\SynEdit-2022.03-11\Source\Highlighters\SynHighlighterMulti.pas on my computer in Delphi 11.1.
-
What if you create the datamodule using Synchronize?
-
1
-
-
But the result contains addresses - just IPv6, not IPv4...
-
1
-
-
Just now, Lainkes said:Can you explain thisÂ
Attribs.Add(aAttrib);
Is aAttrib the field that I need? In my case the language field?
Yes, but I do not know its name.
-
26 minutes ago, Lainkes said:Thanks for your answer.
I'm struggeling withÂ
RozdelLdap
What is that function? Delphi does not recognise it.
It was my function. It takes a string in the form "cn=Valek,ou=OOOO,o=XXX" and divides it to Cn "cn=Valek" and Base "ou=OOOO,o=XXX"
(I was dividing it using the first coma in the input string.)
-
Â
function LdapGetAttribute(aUserFqdn: string; aAttrib: string): string; var Ldap: TLDAPSend; Attribs: tStringList; Cn, Base: string; begin result:=''; Ldap:=TLDAPSend.Create; try Ldap.UserName:=Config.LdapUser; Ldap.Password:=Config.LdapPassword; Ldap.TargetHost:=Config.LdapHost; Ldap.TargetPort:=Config.LdapPort; Ldap.AutoTLS:=true; if Ldap.Login then begin if Ldap.Bind then begin Attribs:=tStringList.Create; try Attribs.Add(aAttrib); RozdelLdap(aUserFqdn, Cn, Base); // cn=Valek,ou=OOOO,o=XXX -> cn=Valek + ou=OOOO,o=XXX Ldap.Search(Base, false, '('+Cn+')', Attribs); if (Ldap.SearchResult.Count>0)and(Ldap.SearchResult[0].Attributes.Count>0) then begin result:=Ldap.SearchResult[0].Attributes[0].Text; end; finally FreeAndNil(Attribs); end; end; end; finally FreeAndNil(Ldap); end; end;
Â
-
Hello, many years ago, I have used something like this for Novell eDir:
Â
function LdapOverPrihlaseni(aUserName, aPassword: string): boolean; var Ldap: TLDAPSend; begin result:=false; if aPassword='' then exit; Ldap:=TLDAPSend.Create; try Ldap.UserName:=aUserName; Ldap.Password:=aPassword; Ldap.TargetHost:=Config.LdapHost; // 'novell.xxxxx.cz'; Ldap.TargetPort:=Config.LdapPort; // '389'; Ldap.AutoTLS:=true; if Ldap.Login then begin if Ldap.Bind then begin result:=true; end; end; finally FreeAndNil(Ldap); end; end;
Â
ldapsend.pas was part of Synapse.
-
1 hour ago, gioma said:Thanks but It doesn't work on Delphi , it needs many corrections 😞
I do use it in Delphi application...
-
I have found and used this, instead of the outdated (maybe it is not in D11.1?) version in Delphi:
https://github.com/CMCHTPC/DelphiDX12
But I do not use TDirect2DCanvas.
-
11 minutes ago, sjordi said:Actually, I don't find it. It's not known from the compiler, and I have no trace whatsover of any file that looks like it besides a DCU file... but not seen
I'm under Alexandria...Docwiki at Embarcadero doesn't reference it either... nor does the help...
I think I'm missing something.
Â
In Delphi 11, it is in C:\Program Files (x86)\Embarcadero\Studio\22.0\source\rtl\common\System.StartUpCopy.pas in my installation.
Help and doc - ehm... Did not find them.
-
1
-
-
51 minutes ago, corneliusdavid said:... Or I could try and remember the built-in keys that do the same thing: ...
Or use something like AutoHotkey and remap them to your favourite hotkeys...
-
2 hours ago, Lajos Juhász said:File a QP report.
Yes.
He could also try to use https://fontforge.org/ and create new font (based on the original one) with changed line spacing. Waiting for implementation of this feature in IDE could take ... ehm... some time 🙂
-
3 minutes ago, Stano said:No, no and no. Don't read the instructions!
I don't know if you want to know: If you do not divide by not an integer, then you have to retype. E.g.
CAST (1/3 AS DOUBLEPRECISSION) AS RESULT Otherwise, the result will be Integer.
This will evaluate to zero:
SELECT CAST (1/3 AS DOUBLE PRECISION) AS RESULT FROM rdb$database
Â
This will ealuate to 0.333333333333333333:
SELECT CAST (1 AS DOUBLE PRECISION) / 3 AS RESULT FROM rdb$database
Â
But original question is about something else (probably windowing functions).
-
7 minutes ago, Henry Olive said:Thank you Vandrovnik
your codes gives error (token unknown line 1 column 2Â cast )
I guess you have copied it without the SELECT...
-
So there must be something different in your real SQL 🙂
Â
What about:
select
 cast(cast(10 as double precision) / 0.3048 * 14.7776 as NUMERIC (18,2))
 from rdb$database a -
select
 cast((10.00000 / 0.3048) * 14.7776 as NUMERIC (18,2))
 from rdb$database aÂ
It works for me.
Without the cast, there is 13 decimal places, so only 5 places is left in front of the decimal point.
Â
Reduce storage space for floating point range
in Algorithms, Data Structures and Class Design
Posted
These numbers are randomly distributed? When not, it might be more space efficient to store differences (after converting them to integers). If differences are small, you could use variable-length storing (7 bit data, 1 bit as indicator, that another byte is used).
And finally a compression.