Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Use logical field (.f.) in a compound index
Message
De
22/06/2007 14:19:23
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
22/06/2007 11:50:23
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Novell 6.x
Database:
Visual FoxPro
Divers
Thread ID:
01235052
Message ID:
01235077
Vues:
21
>>Greetings all,
>>I am attempting to use a logical field name checkStub (.f., or .t.) in a compound index. The code requires the field to remain a logical fields: .f. or .t. I would like to sort in a compound index with a character field named vendCode. I tried:
>>
>> str(checkStub) + vendCode
>>
>>but that gives me "invalid type".
>>
>>Any ideas?
>>
>>thanks, vince
>
>To combine several fields, you must normally convert everything to character type.
>
>Here are two alternatives:
>
>
>* Option 1
>index on transform(CheckStub) + VendCode
>
>* Option 2 - smaller index
>index on iif(CheckStub, "1", "0") + VendCode
>* or
>index on iif(CheckStub, "T", "F") + VendCode
>
And a short version of option 1, ergo 1b:
index on TRANSFORM(CheckStub, "Y") + VendCode
The nice thing about all these is that the false values will come before true values. I wish we had that order in language, when naming code: post_hook comes before pre_hook; "before_*" comes after "after_*"... whichever word pair I tried, it sorts wrongly.

Hmmm... maybe ante- and post- would be good?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform