Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   Prüfen ob String = Farbcode ist (https://www.delphipraxis.net/53342-pruefen-ob-string-%3D-farbcode-ist.html)

ichbins 14. Sep 2005 15:47

Re: Prüfen ob String = Farbcode ist
 
ihr habt vergessen, das clblack und so zeugs auch dazugehört. einfach mit stringtocolor probieren und mit try except absichern:
Delphi-Quellcode:
function iscolorcode(s:string):boolean;
begin
  try begin
    stringtocolor(s);
    result:=true;
  end except
    result:=false;
  end;
end;

malo 14. Sep 2005 15:54

Re: Prüfen ob String = Farbcode ist
 
Zitat:

Zitat von ichbins
ihr habt vergessen, das clblack und so zeugs auch dazugehört. einfach mit stringtocolor probieren und mit try except absichern:
Delphi-Quellcode:
function iscolorcode(s:string):boolean;
begin
  try begin
    stringtocolor(s);
    result:=true;
  end except
    result:=false;
  end;
end;

Nimmt der Compiler das bei der Eingabe auch an? Ich dachte, clBlack, clWhite etc. wären nur Delphi-interne Konstanten. Dass der Compiler die auch als Eingabe akzeptiert, wär mir neu :gruebel: (soll nich heißen, dass ich es bestreite :) ) ;)

kingflo 14. Sep 2005 17:28

Re: Prüfen ob String = Farbcode ist
 
Ne der Compiler nimmt auch clBlack usw...

Aber das brauche ich nicht zu berücksichtigen, denn ich brauche nur die eingabe von HTML Farbcodes prüfen


Alle Zeitangaben in WEZ +1. Es ist jetzt 17:54 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz