Como Gerar ID ou Chave Única versão 2
Sugestão de Dica Enviada por Ivan.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| uses
System.DateUtils,…
function GenerateUniqueName(const pPrefix: string = ”): string;
var
LMilsSince: Int64;
begin
if pPrefix.Trim.IsEmpty then
Result := ‘xyz’
else
Result := pPrefix.Trim;
Sleep(1);
LMilsSince := MilliSecondsBetween(DateDelta, Now);
Result := Result + LMilsSince.ToString;
end; |
uses
System.DateUtils,…
function GenerateUniqueName(const pPrefix: string = ”): string;
var
LMilsSince: Int64;
begin
if pPrefix.Trim.IsEmpty then
Result := ‘xyz’
else
Result := pPrefix.Trim;
Sleep(1);
LMilsSince := MilliSecondsBetween(DateDelta, Now);
Result := Result + LMilsSince.ToString;
end;
Post Views: 2.799
-
Ivan Cesar
-
- 0 comentários
- 9 de abril de 2018