![]() |
Re: Integer umwandeln (ähnlich IntToHex)
Hi,
Stimmt :) Kann ja vom Code garnicht sein. Allers klar, werde es erweitern. Dankeschön! |
Re: Integer umwandeln (ähnlich IntToHex)
Du könntest ein eigene ChrToInt-Funktion schreiben, so in der Art:
Delphi-Quellcode:
So in die Richtung. Es handelt sich ja immer nur um ein Char, das umgewandelt wird.
function ChrToInt2(Value: Char): Integer;
begin Result := 0; try Result := IntToStr(Value); except Result := Ord(Value) - 55; end; end; |
Re: Integer umwandeln (ähnlich IntToHex)
Hi,
noch einfacher gehts so:
Delphi-Quellcode:
klappt wunderbar :)
function BaseToDec(Value:String; Base:Integer):Int64;
var i, j:Integer; begin j:=0; Result:=0; for i:=Length(Value) downto 1 do begin Result:=Result + getint(Value[i]) * Potenz(Base,j); <-- getint inc(j); end; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:44 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz