Autor Beitrag
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Mo 28.04.03 12:33 
wie kann ich überprüfen, ob in einem editfeld nur Großbuchstaben eingegeben sind?
wenn ich es so mache:
ausblenden Quelltext
1:
if uppercase(str)=str) then ...					

dann wird auch, wenn im edit z.B. nur sowas steht:
Zitat:
;)

weitergemacht...
das will ich aber gerne verhindern...

also geht es im Prinzip darum zu schauen, ob Buchstaben im Edit stehen


Zuletzt bearbeitet von Raphael O. am Mo 28.04.03 15:57, insgesamt 1-mal bearbeitet
Terra23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: Mo 28.04.03 12:52 
Mußt du nicht überprüfen, ob:
ausblenden Quelltext
1:
2:
If Not Key=Shift /// als Code natürlich
And Not Key In [0..9] etc. /// auch als Code

dann..

Moderiert von user profile iconTino: Code-Tags hinzugefügt.

_________________
Hasta La Victoria Siempre
Raphael O. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Mo 28.04.03 15:46 
dass müsste ich dann aber immer bei der Texteingabe machen...
und wenn man dann wieder was weglöscht...
nee, lieber nicht... ich würde das lieber an dem fertigen Text austesten...
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: Mo 28.04.03 15:55 
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
function IsGrossbuchstaben(const S: String): Boolean;
var
  I: Integer;
begin
  Result := True;
  for I := 1 to Length(S) do begin
    if not (S[I] in [#65..#90]) then begin
      Result := False;
      Exit;
    end;
  end;
end;
Gruß wulfskin!

_________________
Manche antworten um ihren Beitragszähler zu erhöhen, andere um zu Helfen.
Raphael O. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Mo 28.04.03 15:57 
cool... thx ;)