Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multiple Index tag - help
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00209679
Message ID:
00209688
Vues:
27
>How about index on fullname + dtos({^2999/03/18}-newDate)

OOPS, that's what stream of consciousness typing does for you. This will really work, I tested it.

This is a little uglier than i would like. It stems from the VFP bug that you can't do this
index on fullname + str({^2999/03/18}-newDate) to myidx. For some bizarre reason this gives you an invalid key length.

If you put x={^2999/03/18} and then
index on fullname + str(x-newDate) to myidx, this works but i don't like to have variables in my index expressions unless absolutely necessary.

I created a little function called DES (short for descending which was already taken)

here it is:

function des
parameters uVar

do case
case vartype(uVar)="N"
return(9999999999-uVar)
case vartype(uVar)="D"
return({^2999/01/01}-uVar)
case vartype(uVar)="C"
local nCnt, cRetVal
cRetVal=""
for nCnt=1 to len(uVar)
cRetVal=cRetVal+chr(ASC("[")-ASC(substr(uVar,nCnt,1))+64)
endfor nCnt
return(cRetVal)
otherwise
=messagebox("unimplemented case")
endcase


using this you can build your index by typing:

index on lastname+str(des(date)) to c:\temp\x


hth

scott
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform