![]() |
Re: Dual Dezimal
<Binärwert> ist hier doch nur ein Platzhalter, du musst natürlich den richtigen Binärwert als String übergeben.
ZB.'101010101010'. |
Re: Dual Dezimal
meinst du das so
Delphi-Quellcode:
var s:string;
begin s:=inttostr (BinToDec (int64)); |
Re: Dual Dezimal
Eigentlich so:
Delphi-Quellcode:
var s:string;
begin s := IntToStr(BinToDec ('101010101010')); end; |
Re: Dual Dezimal
aso ja das hab ich auch schon probiert des geht ja.
ich hab grad nochma geschaut ich hab mich glaub net richtig ausgedrückt also ich will in edit2.text eine dual zahl eingeben un in edit1.text soll die dezi zahl stehen
Delphi-Quellcode:
anstatt <binärcode> muss ich ja irgendwie das result aus der function nehmen oder?
function BinToDec(s:string):int64;
var p:int64; i:integer; begin p:=0; for i:=1 to length(s) do p:=p*2+ord(s[i])-ord('0');//s[i] must be '0' or '1' result:=p; end; procedure TForm2.Button2Click(Sender: TObject); begin edit1.Text := IntToStr( BinToDec (<binärcode>)); end; end. |
Re: Dual Dezimal
Delphi-Quellcode:
function BinToDec(s:string):int64;
var p:int64; i:integer; begin p:=0; for i:=1 to length(s) do p:=p*2+ord(s[i])-ord('0');//s[i] must be '0' or '1' result:=p; end; procedure TForm2.Button2Click(Sender: TObject); begin edit1.Text := IntToStr( BinToDec (Edit2.Text)); end; end. |
Re: Dual Dezimal
boah bin ich blöd :wall: :wall: :wall: :wall: :wall: :wall: :wall:
Thx @ all |
Re: Dual Dezimal
Zitat:
Delphi-Quellcode:
Edit1.Text := IntToStr( BinToDec( edit2.text ));
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:26 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