Autor Beitrag
shrubman
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Do 18.11.04 16:36 
Wie kann ich sagen dass nur abc buchstaben in einer edit eingabe möglich ist also die buchstaben von 1-26 ????
neojones
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1206
Erhaltene Danke: 1



BeitragVerfasst: Do 18.11.04 16:45 
"Buchstaben von 1-26" ;-) Wir sollten eine Stilblüten-Rubrik aufmachen.

Schau Dir mal MaskEdit an. Da kannst des definieren.

Viele Grüße,

Matthias

_________________
Ha! Es compiliert! Wir können ausliefern!
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Do 18.11.04 16:59 
Zitat:
Schau Dir mal MaskEdit an
ich persönlich finde das MaskEdit eklig, imho musst du da sowieso vorher di eBuchstabenanzahl wissen. aber wie immer hilft die Forumsuche:

hier, hier, hier, hier oder hier

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
shrubman Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Fr 19.11.04 15:20 
gut und wie mache ich das wenn ich möchte dass es egal ist ob man groß und klein buchstaben eingibt
irgendwie so aber wie genau ? :
ausblenden Delphi-Quelltext
1:
2:
3:
4:
if 
Editfeld.Text=lowercase
then 
A:=uppercase(A);
neojones
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1206
Erhaltene Danke: 1



BeitragVerfasst: Fr 19.11.04 15:30 
Genauso.

if UPPERCASE(vergleichswert1) = UPPERCASE(vergleichswert2)

_________________
Ha! Es compiliert! Wir können ausliefern!
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Fr 19.11.04 15:31 
Zitat:
gut und wie mache ich das wenn ich möchte dass es egal ist ob man groß und klein buchstaben eingibt

gar nicht, denn es ist bereits egal (vgl. 3. Link)

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
shrubman Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Fr 19.11.04 15:45 
ich habe da ein hangman programm gemacht und Edit2.Text[1]:=A gesetz A ist char.
dann habe ich gesagt wenn er richtige wörter eingibt setz er sie auf die richtig liste und bei falsch auf eine falsch liste... h ist richtig aber wenn ich H eingebe ist es falsch... das sollte aber beides richtig sein und die beiden möglichkeiten von euch ... das klappt nicht so recht
ausblenden Delphi-Quelltext
1:
2:
3:
4:
if
Edit2.Text=lowercase
then
A:=uppercase(A);

dann sagt er immer inkompatible typen char und string und nicht genügend parameter ( fehler bei then
shrubman Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Fr 19.11.04 19:13 
ich habe mir da eine lösung mal gemacht :
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
procedure TForm1.Button2Click(Sender: TObject);
var Wort,Buchstabe:string;
    zaehler,zaehler2,zaehler3:integer;
    abfrage1,abfrage2:bool;
begin
abfrage2:=false;
Wort:=Label2.Caption;
Buchstabe:=Edit2.Text[1];

for zaehler2:=65 to 90 do
begin
if
Buchstabe=chr(zaehler2)
then
begin
grossbuchstaben:=true;
end
else
grossbuchstaben:=false;
end;


for zaehler3:=97 to 122 do
begin
if
Buchstabe=chr(zaehler3)
then
begin
kleinbuchstaben:=true;
end
else
kleinbuchstaben:=false;
end;

if
(kleinbuchstaben)
or (grossbuchstaben)
then
begin
[...]

Problem da wo[...] steht das macht er nie... warum nicht auch wenn ich A bzw a reinschreibe obwohl A=chr(65) ist und das eigentlich in der for to do schleife gesagt wird... Hat jemand eine Idee woran das liegt ?
Basti
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 345

Windows Vista
D2005 Pers, D7 Pers
BeitragVerfasst: Fr 19.11.04 19:43 
Wo definierst du die Variablen grossbuchstaben und kleinbuchstaben? Global?
Die Fehlermeldung wäre ganz hilfreich denke ich - habe es aber nur überflogen...

_________________
Der Computer ist die logische Weiterentwicklung des Menschen: Intelligenz ohne Moral.
shrubman Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Fr 19.11.04 19:48 
ja sind global definiert... habe aber eine andere lösung gefunden also für mich musst du es nicht mehr lösen aber trotzdem danke!!!
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Fr 19.11.04 20:27 
@shrubman:
nur mal so als tipp, vielleicht solltest du dir diesen thread mal angucken :wink:

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 20.11.04 01:01 
Noch mal: Du willst, dass man nur Buchstaben in ein Edit eingeben kann? Ich frage nur nach, weil das was ihr bisher produziert habt sieht nach allem anderen aus, nur nicht danach.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  if not (Key in ['a'..'z', 'ä', 'ö', 'ü', 'ß', 'A'..'Z', 'Ä', 'Ö', 'Ü']) then
    Key := #0;
end;