AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

bin2dec

Ein Thema von n00b_on_knees · begonnen am 5. Apr 2003 · letzter Beitrag vom 6. Apr 2003
Antwort Antwort
Daniel B
(Gast)

n/a Beiträge
 
#1
  Alt 6. Apr 2003, 08:35
Moin Christian,
Zitat von Christian Seehase:
  if (length(AsValue) < 1) or (length(AsValue) > 32) then
Das hat mich auf eine Idee gebracht.
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
  bByte: Byte;
  iErgebnis: Integer;
begin
  iErgebnis := 0;
  bByte := StrToInt(Edit1.Text);
  if (bByte and 1) <> 0 then
    iErgebnis := iErgebnis + 1;
  if (bByte and 2) <> 0 then
    iErgebnis := iErgebnis + 2;
  if (bByte and 4) <> 0 then
    iErgebnis := iErgebnis + 4;
  if (bByte and 8) <> 0 then
    iErgebnis := iErgebnis + 8;
  if (bByte and 16) <> 0 then
    iErgebnis := iErgebnis + 16;
  if (bByte and 32) <> 0 then
    iErgebnis := iErgebnis + 32;
  if (bByte and 64) <> 0 then
    iErgebnis := iErgebnis + 64;
  if (bByte and 128) <> 0 then
    iErgebnis := iErgebnis + 128;
  ShowMessage(IntToStr(iErgebnis));
end;
Grüsse, Daniel
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 15:29 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