Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 04/09/20 in all areas

  1. Dalija Prasnikar

    freeing an object in different process

    No caveats for above code. You can freely Free object instance from different thread than one where it is created. Problem would arise if you would have object instance that is being simultaneously accessed by multiple threads.
  2. vfbb

    IPV6 to number

    Because the used methods of the BigInteger changes a global variable. BigInteger.Hex; BigInteger.Decimal; But I was looking, it is possible to avoid these methods, so this new example will be safe: uses System.SysUtils, Velthuis.BigIntegers; function IPV6ToNumberDigits(const AIPV6: string): string; var LBigInteger: BigInteger; begin if not BigInteger.TryParse(AIPV6.Replace(':', '', [rfReplaceAll]), 16, LBigInteger) then Exit(''); Result := LBigInteger.ToString; end; function NumberDigitsToIPV6(const ANumberDigits: string): string; var I: Integer; begin if ANumberDigits.IsEmpty then Exit(''); Result := BigInteger(ANumberDigits).ToHexString.ToLower.PadLeft(32, '0'); for I := 0 to 6 do Result := Result.Insert((4 * (I+1)) + I, ':'); end;
  3. And to add all library paths, I created one tool that add all paths of all platforms in one click also. https://github.com/viniciusfbb/delphi-tools
×