Delphi

Facebook Twitter

Components

Integração. Accurate Difference Between Two TDateTime Values - Or How Old/Young Are You In Milliseconds! Article submitted by Carlos Barreto Feitoza Filho.

Accurate Difference Between Two TDateTime Values - Or How Old/Young Are You In Milliseconds!

In my wanderings through the web, I discovered that the DateUtils unit contains several rounding problems and its accuracy is very poor. There is a proposal on the Quality Central for changes in this unit so that it is as accurate as one millisecond: Report # 56957 - The Fix is DateUtils Date-Time Compare Functions. Two TDateTime Values - Difference in Milliseconds! Here I intend to code the shortest path to creating a function that obtains precisely (1 millisecond) the difference between two dates passed as parameter. The result is a record in years, weeks, days, hours, minutes, seconds and milliseconds which is the difference of full dates! Contact Sales or Find Partner. Turbo Delphi Explorer - Instalar Componentes de Terceiros. Delphi 5 Developer's Guide: Contents. Speed Up Your FieldByName Expressions in Delphi Database Applications. Code submitted by Jens Borrisholt How Fast is FieldByName?

Speed Up Your FieldByName Expressions in Delphi Database Applications

In Delphi database application where you need to set or read a value from a field in a dataset, you would (at least once) have a line of code where you would be using the FieldByName method. FieldByName(FieldName) retrieves field information for a field given its name. FieldName is the name of an existing field. FieldByName returns the TField component that represents the specified field. Dicas de Delphi - Outros. Mac Address do adaptador de rede A função abaixo retorna o Mac Address do adaptador de rede: function MacAddress: string; var Lib: Cardinal; Func: function(GUID: PGUID): Longint; stdcall; GUID1, GUID2: TGUID; begin Result := ''; Lib := LoadLibrary('rpcrt4.dll'); if Lib <> 0 then begin @Func := GetProcAddress(Lib, 'UuidCreateSequential'); if Assigned(Func) then begin if (Func(@GUID1) = 0) and (Func(@GUID2) = 0) and (GUID1.D4[2] = GUID2.D4[2]) and (GUID1.D4[3] = GUID2.D4[3]) and (GUID1.D4[4] = GUID2.D4[4]) and (GUID1.D4[5] = GUID2.D4[5]) and (GUID1.D4[6] = GUID2.D4[6]) and (GUID1.D4[7] = GUID2.D4[7]) then begin Result := IntToHex(GUID1.D4[2], 2) + '-' + IntToHex(GUID1.D4[3], 2) + '-' + IntToHex(GUID1.D4[4], 2) + '-' + IntToHex(GUID1.D4[5], 2) + '-' + IntToHex(GUID1.D4[6], 2) + '-' + IntToHex(GUID1.D4[7], 2); end; end; end; end; Início.

Dicas de Delphi - Outros

Blog do Walter.