Autor Beitrag
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: Mi 04.06.03 13:49 
Tach,
beim Versuch den BatteryFlag abzufragen, bekomme ich einen Rückgabewert, der sich aus 1,2,4,8... zusammensetzt. Soweit sogut, wenn X nun aber 3 ist, woher weiß ich dann,
das 1+2 "aktiv" sind. Also X=3 --> X=[1;2]. Sollte jemand verstehen, was ich meine, verdient er einen Preis :oops:

Danke im Voraus,
maxk

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 04.06.03 13:57 
Hallo,

so kannst Du es überprüfen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
x := 3;

If (x and 1) = 1 Then
  ;
If (x and 2) = 2 Then
  ;
If (x and 4) = 4 Then
  ;
If (x and 8) = 8 Then
  ;
maxk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Mi 04.06.03 14:19 
Danke, es funktioniert ! :dunce:

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.