Autor Beitrag
F.Art
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: Di 04.10.05 18:21 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
if (Usernamen.Text='') or (Usernamen.Text=' ') or (Usernamen.Text='  ') or
   (Usernamen.Text='   ') or (Usernamen.Text='    ') or (Usernamen.Text='     ') or
   (Usernamen.Text='      ') or (Usernamen.Text='       ') or (Usernamen.Text='        ') or
   (Usernamen.Text='         ') or (Usernamen.Text='          ') or (Usernamen.Text='           ') or
   (Usernamen.Text='            ')
   then


Wie kann ich das einfacher gestallten?
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 04.10.05 18:24 
Moin!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
uses
  ..., StrUtils;

if (Trim(Usernamen.Text) = '') then


cu
Narses
XpreZz
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35



BeitragVerfasst: Mi 05.10.05 00:54 
Sorry wenn ich frage aber was genau macht das ?!

Wenn also in Usernamen kein Text ist dann...

Oder wofür ist das ?
Stübi
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 331

Win XP, Win 2000, Win ME
D5 Ent, D7 Prof, D2005 PE, C#
BeitragVerfasst: Mi 05.10.05 07:08 
Aus der Delphi Hilfe:
Zitat:

Trim removes leading and trailing spaces and control characters from the given string S.


Was Grob übersetzt etwa soviel heissen mag wie: Trim löscht Space (Leerschläge) und Kontrollzeichen am Anfang und am Ende eines gegebenen Strings.

Wie gesagt grob übersetzt!

Gruss Stübi

_________________
Neun von zehn Stimmen in meinen Kopf sagen, dass ich nicht verrückt sei. Die zehnte summt die Tetrismelodie.