Autor Beitrag
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: Mo 14.02.05 10:52 
www.if-schleife.de behauptet es gibt keine if schleifen sondern nur if-abfragen, dann stell ich mal folgendes in den raum:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
procedure ifschleife;  // if schleife
var i: integer;
label weiter;
begin
  i := 0;
  weiter:
    form1.listbox1.items.Add(inttostr(i));
    inc(i);
  if i < 10 then goto weiter;  // if abfrage
end;

procedure repeatschleife;  // repeat schleife
var i: integer;
begin
  i := 0;
  repeat
    form1.listbox1.items.Add(inttostr(i));
    inc(i);
  until i = 10;  // repeat abfrage
end;


ist das 1. eine if schleife oder nicht? was denkt ihr dazu ^_^


Moderiert von user profile iconChristian S.: Topic aus Sonstiges verschoben am Mo 14.02.2005 um 11:12
PattyPur
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 80

Win98, WinXP
Delphi 7
BeitragVerfasst: Mo 14.02.05 11:01 
Dies ist zwar eine Schleifenkonstruktion, aber den ausdruck IF-Schelife würde ich dafür nicht verwenden - eher GOTO Schleife, weil das GOTO für das Schleifenverhalten sorgt.

Deine IF-Abfrage ist lediglich die Bedingungsprüfung.
Ein IF ist immer eine Konditionale Frage (IF (englisch) = Wenn)

Allgemein empfehle ich von der verwendung des GOTO abzusehen, da eine verwendung dieses Befehl sehr schnell zu unübersichtlichen und unstrukturierten Code sorgen kann.
uall@ogc Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: Mo 14.02.05 11:09 
klar würde ich nie eine "if-schleife" benutzen, wollte aber www.if-schleife.de halt widersprechen :> es geht nur darum wie man diese schleife da nennt :P
maximus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 896

Win XP, Suse 8.1
Delphi 4/7/8 alles prof
BeitragVerfasst: Mo 14.02.05 15:34 
Wenn das ne if-schleife sein soll, dann is dies auch eine:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
if true then
  repeat
    ...;
  until false;


:D

_________________
mfg.
mâximôv
ScorpionKing
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1150

Win XP

BeitragVerfasst: Mo 14.02.05 15:44 
oder:

ausblenden Delphi-Quelltext
1:
2:
hier:
if true then goto hier


das ist dann eine endlos-schleife! hehe!

_________________
Aus dem Urlaub zurück!
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mo 14.02.05 15:48 
Bei wikipedia sind Konstrukte mit Sprung-Befehlen (Goto) auch als Schleifen zu betrachten.
ScorpionKing
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1150

Win XP

BeitragVerfasst: Mo 14.02.05 15:50 
jasocul hat folgendes geschrieben:
Bei wikipedia sind Konstrukte mit Sprung-Befehlen (Goto) auch als Schleifen zu betrachten.

sind ja auch welche! eben!

_________________
Aus dem Urlaub zurück!
maximus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 896

Win XP, Suse 8.1
Delphi 4/7/8 alles prof
BeitragVerfasst: Mo 14.02.05 15:51 
jasocul hat folgendes geschrieben:
Bei wikipedia sind Konstrukte mit Sprung-Befehlen (Goto) auch als Schleifen zu betrachten.


da spricht auch nix dagegen :wink:

_________________
mfg.
mâximôv
ScorpionKing
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1150

Win XP

BeitragVerfasst: Mo 14.02.05 15:53 
wo wir grad dabei sind: wer hat diese intelligente seite (www.if-schleife.de) eigentlich gemacht?

_________________
Aus dem Urlaub zurück!
freak4fun
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 604
Erhaltene Danke: 4

Win 7 Pro
VS 2013 Express, Delphi, C#, PHP, Java
BeitragVerfasst: Mo 14.02.05 15:54 
GOTO? GOTO HELL! :lol:

MfG
fR34k
IngoD7
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 629


D7
BeitragVerfasst: Mo 14.02.05 15:54 
maximus hat folgendes geschrieben:
jasocul hat folgendes geschrieben:
Bei wikipedia sind Konstrukte mit Sprung-Befehlen (Goto) auch als Schleifen zu betrachten.


da spricht auch nix dagegen :wink:

So isses. Dass es eine Schleife ist, ist ja nicht bestritten. Nur der Begriff ... :roll:


Den Begriff "if-schleife" *schüttel* habe ich das erste mal irgendwann hier im Forum gelesen. Ich bin der Meinung, auch vorher gut ohne ihn klargekommen zu sein. Es weiß zwar jeder ungefähr, was damit gemeint ist, doch der Ansicht, dass es sowas nicht gibt (geben dürfte), schließe ich mich an.

Was wäre denn sowas:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
label HierSchleife;
...
if Bedingung then goto Weiter;
goto HierSchleife;
label Weiter;
...

Wäre das eine "von-if-unterbrochen-schleife"? :lol:
MitschL
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 211

Win 98 SE, Win 2000
D5 Pers, D6 Pers und D7 Pro
BeitragVerfasst: Mo 14.02.05 16:05 
Nun,

man sollte vielleicht auf die Granularität achten. Eine For-Next-Schleife gibt es nicht als For-Konstrukt, oder in anderen Teilen. Es ist und bleibt eine Schleife und als solche auch nur mit allen notwendigen Elementen.

Umgekehrt ist es mit einer If-Bedingung. Das sie hier für eine Schleife genutzt wird, ist nicht ihr Verdienst (das liegt nämlich beim goto), weswegen man nicht von einer if-Schleife sprechen kann.

gegrüßt!

_________________
"Bloßes Ignorieren ist noch keine Toleranz." (Theodor Fontane)
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mo 14.02.05 16:06 
Der Link zu wikipedia war zur Vollständigkeit.

@Ingo:
Dafür würde ich jedem Auszubildenden die Finger abhacken. :twisted:

Ich stelle mir gerade vor, ich sollte in einem solchen Source einen Fehler suchen :nut: :autsch: :bawling:
IngoD7
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 629


D7
BeitragVerfasst: Mo 14.02.05 16:13 
jasocul hat folgendes geschrieben:
@Ingo:
Dafür würde ich jedem Auszubildenden die Finger abhacken. :twisted:
Brauchste nicht mehr.
Mir sind sie beim Tippen schon abgefault. :wink:
zemy
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 207

Win XP Prof.
D7
BeitragVerfasst: Di 15.02.05 16:42 
ScorpionKing hat folgendes geschrieben:
wo wir grad dabei sind: wer hat diese intelligente seite (www.if-schleife.de) eigentlich gemacht?


Habe ich mich auch gerade gefragt :D (bevor ich dein Post gelesen habe) Kannst ja mal bei Denic.de (Domainabfrage) nachschauen....

MfG Zemy
maximus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 896

Win XP, Suse 8.1
Delphi 4/7/8 alles prof
BeitragVerfasst: Mi 16.02.05 17:07 
Wenn etwas der Bedeutung von if-schleife nahe kommt, dann wohl am ehesten eine While-schleife :shock:

ausblenden Delphi-Quelltext
1:
whileIf (x < 42) do begin ... end;					


*duck*

_________________
mfg.
mâximôv
MitschL
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 211

Win 98 SE, Win 2000
D5 Pers, D6 Pers und D7 Pro
BeitragVerfasst: Mi 16.02.05 17:42 
Wenn, dann:whileIf (x < 42) thendo begin ... end;

gegrüßt!

_________________
"Bloßes Ignorieren ist noch keine Toleranz." (Theodor Fontane)