Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BINTOC() ¿Works in index?
Message
From
10/07/1998 16:51:27
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
09/07/1998 12:57:50
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00115812
Message ID:
00116314
Views:
17
>I've read in VFP documentation that bintoc function may be used to reduce size of indexes. I've tested without success: bintoc(1) returns the same string than bintoc(2), 3, 4 etc. So how can be used to order records?
>What i'm forgeting?
>Thanks

It creates a four-byte string which can be concatenated with others. It probably makes indexes much shorter than when you use numeric indexes; though, it ignores the decimal part, but then - a numeric index rarely has one, does it?

The real gain is when you have had an index on two numeric fields, like
inde on str(numfield1)+str(numfield2)
if these fields had some decimals or length of 6 or more digits, the resulting key length would be 12 or more bytes.
inde on bintoc(numfield1)+bintoc(numfield2)
will surely be 8 bytes long, and be as quick as an index on integer.

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