Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object Browser and negative hex numbers
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00596369
Message ID:
00596419
Vues:
23
>>>I was looking for something in the object browser and notice following:
>>>Constant wdAlertsAll = -1
>>>Hex: -0x00000001, Bin: 11111111
>>>Member of Word (cached).WdAlertLevel
The part that get me curious is
Hex: -0x00000001
I never encountered negative hex numbers before. Shouldn't it be?
Hex: 0xff
>>
>>If it's a DWORD, then it should be 0xFFFFFFFF. The binary representation you show is only a byte. Generally, bytes are unsigned, words and dwords can be signed or unsigned. Why the representation the way it is, I can only guess.
>
>I just tried
? -0x00000001
and VFP shows it as -1. At least it works in VFP.

It's valid, Sergey. AFAIK, VFP treats all hexadecimal representations of DWORDS as unsigned. Certain operations, however, treats them as signed. Try the following from the command window
lnvar = 0xFFFFFFFF
? lnvar
lnvar = BITOR(lnvar, 0)
? lnvar
To see what I mean.
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform