Autor Beitrag
death-adders
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 82

Vista
Turbo Delphi Explorer
BeitragVerfasst: Di 16.05.06 15:35 
hi!

also ich habe in meinem projekt 5 edit felder und muss prüfen, in welchem kein wert steht und in welchem ein wirt drinne ist. aber mein pc mag das nicth so recht!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
  If edtY.text = ''
    and edtX.text <> 1
     and edtA.text <> 1
       and edtB.Text <> 1
         and edtC.text <> then ereignis


edtX, edta, edtB und edtC sind alles edtfelder. aber er gibt ne fehlermeldung von wegen inkompatible types

kann mir jemand gelfen?
azubi_20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Di 16.05.06 15:41 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
  If edtY.text = ''
    and edtX.text <> '1'
     and edtA.text <> '1'
       and edtB.Text <> '1'
         and edtC.text <> 'x' then ereignis
der Berliner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 417

Win Xp Home
delphi 2005
BeitragVerfasst: Di 16.05.06 15:41 
user profile icondeath-adders hat folgendes geschrieben:
hi!

also ich habe in meinem projekt 5 edit felder und muss prüfen, in welchem kein wert steht und in welchem ein wirt drinne ist. aber mein pc mag das nicth so recht!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
  If (edtY.text = '')
    and (edtX.text <> intToStr(1))
     and (edtA.text <> intToStr(1))
       and (edtB.Text <> intToStr(1))
         and (edtC.text <> )then ereignis //<<<---Hier Steht nichts zum vergleichen



So sollte es klappen.
Gruß

_________________
[b]Ich weiß nicht immer, wovon ich rede. Aber ich weiß, dass ich recht habe.[b]
starsurfer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 334

Win 95, Win 98, Win XP, Win Vista, Linux
D5 Enterprise ,D2005, D6 Personal, Visual C++ Express 2005, C++ Builder 6 E, Dev-C++
BeitragVerfasst: Di 16.05.06 15:47 
user profile iconder Berliner hat folgendes geschrieben:
user profile icondeath-adders hat folgendes geschrieben:
hi!

also ich habe in meinem projekt 5 edit felder und muss prüfen, in welchem kein wert steht und in welchem ein wirt drinne ist. aber mein pc mag das nicth so recht!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
  If (edtY.text = '')
    and (edtX.text <> intToStr(1))
     and edtA.text <> intToStr(1))
       and edtB.Text <> intToStr(1))
         and (edtC.text <> )then ereignis //<<<---Hier Steht nichts zum vergleichen



So sollte es klappen.
Gruß


1. inttostr(1) isses gleiche wie '1' //das abfragen ist aber ungünstig, wenn 2 drinne steht macht er Mist
2. wenn man mehrere Bedingungen hat, müssen diese in Klammern(und wirklich alle!) :mahn:

zur Frage:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
if edit1.text='' then
 begin
 //das Edit ist leer
 end
  else
 begin
 // im Edit steht was drinne (Zahlen)
 end;

_________________
GEIZ IST GEIL! - Ihr Sozialamt


Zuletzt bearbeitet von starsurfer am Di 16.05.06 15:52, insgesamt 1-mal bearbeitet
death-adders Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 82

Vista
Turbo Delphi Explorer
BeitragVerfasst: Di 16.05.06 15:51 
user profile iconazubi_20 hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
  If edtY.text = ''
    and edtX.text <> '1'
     and edtA.text <> '1'
       and edtB.Text <> '1'
         and edtC.text <> 'x' then ereignis


das geht nicht, da sagt der: "operator not applicable to this operand type"



user profile iconder Berliner hat folgendes geschrieben:
user profile icondeath-adders hat folgendes geschrieben:
hi!

also ich habe in meinem projekt 5 edit felder und muss prüfen, in welchem kein wert steht und in welchem ein wirt drinne ist. aber mein pc mag das nicth so recht!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
  If (edtY.text = '')
    and (edtX.text <> intToStr(1))
     and (edtA.text <> intToStr(1))
       and (edtB.Text <> intToStr(1))
         and (edtC.text <> intToStr)then ereignis //<<<---Hier Steht nichts zum vergleichen - habe ich verbessert



So sollte es klappen.
Gruß


und das geht auch nicht, da sagt der: " Incompatible types: 'string' and 'boolean'
'then'expected but ')' found"
azubi_20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Di 16.05.06 15:52 
So, um noch mal zusammenfassend alles richtig zu machen :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
  
If (edtY.text = '')   and
   (edtX.text <> '1'and
   (edtA.text <> '1'and
   (edtB.Text <> '1'and
   (edtC.text <> 'x'// <-- oder was auch immer
then ereignis
Stoney
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 122

Mac OS X 10.6 "Snow Leopard", Ubuntu Linux 9.04, Mandriva 2010, Win 7, Win Vista, Win XP
Object Pascal (Turbo Delphi, FPC 2.2.4, Lazarus), C++ (Code::Blocks, XCode), Java (Eclipse)
BeitragVerfasst: Di 16.05.06 15:55 
Probier's mal so:
(Alle Lösungen miteinander vermischt und noch ne Klammer drum rum :) )

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
  If ((edtY.text = '')
    and (edtX.text <> '1')
     and (edtA.text <> '1')
       and (edtB.Text <> '1')
         and (edtC.text <> 'x')) then 
ereignis
death-adders Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 82

Vista
Turbo Delphi Explorer
BeitragVerfasst: Di 16.05.06 15:57 
user profile iconazubi_20 hat folgendes geschrieben:
So, um noch mal zusammenfassend alles richtig zu machen :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
  
If (edtY.text = '')   and
   (edtX.text <> '1'and
   (edtA.text <> '1'and
   (edtB.Text <> '1'and
   (edtC.text <> 'x'// <-- oder was auch immer
then ereignis


jo danke, das geht! gibt nur noch einen haken, wenn nu z.B. bei editX nichts, also gar nichts drin steht, dann gibt es ne fehlermeldung, aber ich wollte, das dann halt garnichts passiert, weil die bedingung j anicht erfüllt wurde!

danke für die suuuper schnelle hilfe!
azubi_20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Di 16.05.06 16:01 
user profile icondeath-adders hat folgendes geschrieben:

jo danke, das geht! gibt nur noch einen haken, wenn nu z.B. bei editX nichts, also gar nichts drin steht, dann gibt es ne fehlermeldung, aber ich wollte, das dann halt garnichts passiert, weil die bedingung j anicht erfüllt wurde!

Bei welcher Aktion gibt es was für ne Fehlermeldung ???
death-adders Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 82

Vista
Turbo Delphi Explorer
BeitragVerfasst: Di 16.05.06 16:09 
user profile iconazubi_20 hat folgendes geschrieben:
user profile icondeath-adders hat folgendes geschrieben:

jo danke, das geht! gibt nur noch einen haken, wenn nu z.B. bei editX nichts, also gar nichts drin steht, dann gibt es ne fehlermeldung, aber ich wollte, das dann halt garnichts passiert, weil die bedingung j anicht erfüllt wurde!

Bei welcher Aktion gibt es was für ne Fehlermeldung ???


ich habe das prog gestartet ind EdtX alles gelöscht, auf den button gedrückt, dann sollte ja eigentlich nsicht passieren aber statt dessen kommt ein richtiges fenster in dem steht Project Project1.exe raised exception class EConvertError with message""is not a valid floating point value'. Process stopped. Use Step or Ru n to continue.
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Di 16.05.06 16:13 
Zeig mal mehr code.. dann rufst du warscheinlich irgendwo StrToInt('') auf.

greetz

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
death-adders Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 82

Vista
Turbo Delphi Explorer
BeitragVerfasst: Di 16.05.06 16:14 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TForm1.BtnRechneClick(Sender: TObject);
begin

  If (edtY.text = ''and
   (edtX.text <> '1'and
   (edtA.text <> '1'and
   (edtB.Text <> '1'and
   (edtC.text <> '1')
then application.Terminate;
end;
azubi_20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Di 16.05.06 16:20 
da kann dieser Fehler gar nicht auftreten...
An welcher stelle hält dein Programm an ?
Vielleicht postest du auch mal deinen ganzen Quelltext, wenns nicht zuviel ist.
death-adders Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 82

Vista
Turbo Delphi Explorer
BeitragVerfasst: Di 16.05.06 16:23 
rofl lol jetz gehts!?!

kp warum!!!

baer vielen dank für die hilfe!!
azubi_20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Di 16.05.06 16:27 
Noch ne kleine Sache : willst du wirklich dein gesamtes Programm beenden, oder nur aus der Prozedur aussteigen ?

ausblenden Delphi-Quelltext
1:
2:
3:
application.terminate; //beendet das Programm

exit; //verlässt sofort die aktuelle Prozedur
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Di 16.05.06 16:27 
das einfachste bei sowas ist ne case-struktur...

naja warum einfach wenns auch kompliziert geht...

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
death-adders Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 82

Vista
Turbo Delphi Explorer
BeitragVerfasst: Di 16.05.06 18:44 
ne, den befehl habe ich nur benutzt, um zu gucken, ob es geht, weil wenn es geht, mussich das prog sowieso beenden.
death-adders Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 82

Vista
Turbo Delphi Explorer
BeitragVerfasst: Di 16.05.06 19:16 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure TForm1.BtnRechneClick(Sender: TObject);
var y, x, a, b, c :real;
begin

  If (edtY.text = ''and
    (edtX.text <> '1'and
     (edtA.text <> '1'and
      (edtB.Text <> '1'and
       (edtC.text <> '1'then begin (X:=strtofloat(edtX.text)) and
                                      (A:=strtofloat(edtA.text)) and
                                       (B:=strtofloat(edtB.Text)) and
                                        (C:=strtofloat(edtC.Text));
                               end;
end;


so, und warum geht das denn dann nicht?????
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Di 16.05.06 19:18 
:shock: :shock: :shock:

Also darauf wirst du wohl auch noch selbst kommen..
Seit wann trennst du Anweisungen mit AND?!?

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
death-adders Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 82

Vista
Turbo Delphi Explorer
BeitragVerfasst: Di 16.05.06 19:23 
ditsch! thx