Einzelnen Beitrag anzeigen

Benutzerbild von dizzy
dizzy

Registriert seit: 26. Nov 2003
Ort: Lünen
1.932 Beiträge
 
Delphi 7 Enterprise
 
#4

Re: Zahlen umwandeln (Bin, Oct, Dec, Hex)

  Alt 15. Dez 2004, 03:21
Dieser Ultrakrampf hier ()...
Zitat von Morlon:
Delphi-Quellcode:
        if Edit1.Text[i] <> '0then
          if Edit1.Text[i] <> '1then
            if Edit1.Text[i] <> '2then
              if Edit1.Text[i] <> '3then
                if Edit1.Text[i] <> '4then
                  if Edit1.Text[i] <> '5then
                    if Edit1.Text[i] <> '6then
                      if Edit1.Text[i] <> '7then
                        if Edit1.Text[i] <> '8then
                          if Edit1.Text[i] <> '9then
                            if Edit1.Text[i] <> 'Athen
                              if Edit1.Text[i] <> 'Bthen
                                if Edit1.Text[i] <> 'Cthen
                                  if Edit1.Text[i] <> 'Dthen
                                    if Edit1.Text[i] <> 'Ethen
                                      if Edit1.Text[i] <> 'Fthen
                                        if Edit1.Text[i] <> 'athen
                                          if Edit1.Text[i] <> 'bthen
                                            if Edit1.Text[i] <> 'cthen
                                              if Edit1.Text[i] <> 'dthen
                                                if Edit1.Text[i] <> 'ethen
                                                  if Edit1.Text[i] <> 'fthen
                                                    bolPruef := False;
...lässt sich auch irre elegant schreiben:
Delphi-Quellcode:
  if not ((Edit1.Text[i] in ['0'..'9']) or (Edit1.Text[i] in ['A'..'F']) or (Edit1.Text[i] in ['a'..'f'])) then
    bolPruef := false;


Nachti,
Fabian

btw: Herzlich wilkommen!
Fabian K.
INSERT INTO HandVonFreundin SELECT * FROM Himmel
  Mit Zitat antworten Zitat