Autor Beitrag
ForzaFCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80


D6 / D7 Personal
BeitragVerfasst: Do 13.05.04 11:44 
Und zwar, ich wollte ein programm erstellen wo man sich einloggen muss um ins hauptformular zu kommen.

Soweit so gut, benutzer kann sich seinem namen in der combobox (name) auswählen muss dazu das passwort in ein edit feld eingeben. problem dabei er soll sich mit mindestens 5 Zeichen anmelden ansonsten soll er fehlermeldung im edit feld anzeigen

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
var pas: string;

begin
  If name.ItemIndex = 0
    then 
      pas := 'passwort'
If passwort.Text = pas
   then begin
      Hauptform.Show;
      PasswortForm.Hide;
If passwort.??? < 4   // Was muss ich ihm hier sagen, das er die fehlermeldung bringt?
   then
     Passwort.text := 'fehlermeldung';


Bitte um schnellst mögliche hilfe!


Danke im voraus

_________________
HANSA ROSTOCK DU SOLLST STRAHLEN..... *sing* Für immer und ewig FC hansa Rostock!
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Do 13.05.04 11:48 
Ich glaube du suchst folgendes:if length(passwort.text)<4 then ...

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
ForzaFCH Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80


D6 / D7 Personal
BeitragVerfasst: Do 13.05.04 12:25 
Dat haut auch net hin, aber ich hab auch ein stück vom code vergessen

das ende
ausblenden Delphi-Quelltext
1:
2:
3:
end
else
Passwort.text := 'falsches Passwort';


ist zwar sinnlos aber wollte es nur mal ausprobieren!!

_________________
HANSA ROSTOCK DU SOLLST STRAHLEN..... *sing* Für immer und ewig FC hansa Rostock!
elimhren
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21


D6 Prof
BeitragVerfasst: Do 13.05.04 13:45 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var pas : String
begin 
  If name.ItemIndex = 0 then pas := 'passwort' 
  if (passwort.Text <> pas) or (length(passwort.text) < 5then ShowMessage('passwort ungültig oder zu kurz'else
    begin
      Hauptform.Show; 
      PasswortForm.Hide; 
    end;
end;


nicht getestet, sollt aber gehen
grüße
johannes