Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BINTOC() and CDX size
Message
From
11/01/1999 17:13:32
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00173567
Message ID:
00174859
Views:
27
>>BinToC() is exactly the function VFP internally uses to create sortable 4-byte combinations for integer keys. It actually adds a 0x7fffffff to the number, so the negative numbers don't appear greater than positive. Using BinToC() simply changes your data type from integer into character, but it's still the same four bytes which VFP uses in both cases. Though, having them represented as characters does allow for concatenation, which is quite handy. I already have some tables where I have a PK constructed as BinToC(FKey)+BinToC(LocalKey) and such.
>
>Good to see you.

I haven't forgotten the beers we planned :)

>That's not exactly the way BINTOC() works. It first does and exclusive OR on the most significant bit which is the sign. Positive numbers have it set, negative have it cleared. It then inverts the order of the bytes. Normally this is stored low byte to high byte. BINTOC() uses high byte to low byte.

Right - I knew there was some more internal jumble, but couldn't remember which. Well, if this world was based on Motorola processors, we wouldn't have this trouble - it stores high byte first.

I think the basic story remains - VFP does use BinToC() internally to build integer keys. Gurus?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform