Autor Beitrag
Christian V.
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 311

Win Xp Prof
Turbo Delphi 2005
BeitragVerfasst: Mo 12.02.07 18:47 
Hallo, ich habe 2 gruppen mit Werten
adv_linex[1..3] und adv_liney[1,,3]
Es soll wahr sein, wenn EIN Wert des Arrays grösser als Null ist in EINER der beiden Gruppen.
Beispiele

Wahr:
adv_linex[1]=2
adv_linex[2]=0
adv_linex[2]=0

adv_liney[1]=1
adv_liney[2]=1
adv_liney[3]=0

Falsch:
adv_linex[1]=0
adv_linex[2]=1
adv_linex[2]=0

adv_liney[1]=0
adv_liney[2]=1
adv_liney[3]=0

Ich habe mir das so gedacht:
ausblenden Delphi-Quelltext
1:
if ((adv_linex[1]<>0)OR(adv_linex[2]<>0)OR(adv_linex[3]<>0))OR((adv_liney[1]<>0)OR(adv_liney[2]<>0)OR(adv_liney[3]<>0))					

Allerdings geht das nicht so wie ich es mir gedacht habe.

PS: wegen den <>: minus werte sind nicht möglich.

_________________
Hardware runs the world, software controls the hardware, code generates software - Have You already coded today?
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Mo 12.02.07 18:58 
Wenn Minus-Werte nicht Möglich Sind:
ausblenden Delphi-Quelltext
1:
2:
if ((adv_linex[1]+adv_linex[2]+adv_linex[3])>0xor ((adv_liney[1]+adv_liney[2]+adv_liney[3])>0then
...

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Christian V. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 311

Win Xp Prof
Turbo Delphi 2005
BeitragVerfasst: Mo 12.02.07 19:08 
Danke für die Antwort, das funktioniert aber irgendwie nicht.

_________________
Hardware runs the world, software controls the hardware, code generates software - Have You already coded today?
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Mo 12.02.07 19:10 
Du meinst wenn in genau einer Gruppe genau ein Wert nichtnull ist.

Solcher Code ist zwar fast unbrauchbar, da unlesbar, aber wenn's in einem Ausdruck sein muss:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
if 
 (((adv_linex[1]<>0)xor(adv_linex[2]<>0)xor(adv_linex[3]<>0)) and 
    not ((adv_linex[1]<>0and (adv_linex[2]<>0and (adv_linex[3]<>0))) xor
 (((adv_liney[1]<>0)xor(adv_liney[2]<>0)xor(adv_liney[3]<>0)) and 
    not ((adv_liney[1]<>0and (adv_liney[2]<>0and (adv_liney[3]<>0))) 
then
...
Grenzgaenger
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 12.02.07 19:14 
sorry, verstehe jetzt nicht was du meinst. aber kannst mal 'ne wahrheitstabelle posten? damit ich auch verstehe was du gerne möchtest, danke.
Christian V. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 311

Win Xp Prof
Turbo Delphi 2005
BeitragVerfasst: Mo 12.02.07 19:17 
Wow, danke vielmals. Nun funktioniert es.
@Grenzgaenger: So wie es Delphifan formuliert hat ists besser zu verstehen.

_________________
Hardware runs the world, software controls the hardware, code generates software - Have You already coded today?