Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INDEX ON....IIF(x,'ASCENDING','DESCENDING')
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00350533
Message ID:
00350783
Vues:
20
Edmond,

Although it is hacking to the max, maybe this can be of help:

contents of udftest.prg:
LPARAMETERS cDA

IF TYPE('gcDA')='U'
PUBLIC gcDA
gcDA=cDa
ENDIF
IF TYPE('gnGroup')='U'
PUBLIC gnGroup
gnGroup=0
ENDIF

IF TYPE('gnCounter')='U'
PUBLIC gnCounter
gnCounter=0
ENDIF



IF gcDA<>cDa
gcDa=cDa
gnCounter=0
gnGroup=gnGroup+1
ENDIF

gnCounter=gnCounter+1

LOCAL dlcRetVal
dlcRetVal=STR(gnGroup,5)+IIF(cDa='A',STR(gnCounter,5),STR(10000-gnCounter,5))


RETURN dlcRetVal


To use it, try this from the command window:

create table test (cKey C(5), cDA C(1))
insert into test (ckey, cda) values ("10001",'A')
insert into test (ckey, cda) values ("10002",'A')
insert into test (ckey, cda) values ("10003",'A')
insert into test (ckey, cda) values ("10004",'A')
insert into test (ckey, cda) values ("10005",'D')
insert into test (ckey, cda) values ("10006",'D')
insert into test (ckey, cda) values ("10007",'D')
insert into test (ckey, cda) values ("10008",'D')
insert into test (ckey, cda) values ("10009",'D')
insert into test (ckey, cda) values ("10010",'A')
insert into test (ckey, cda) values ("10011",'A')
insert into test (ckey, cda) values ("10012",'A')
insert into test (ckey, cda) values ("10013",'D')
insert into test (ckey, cda) values ("10014",'D')
select udftest(cda),* from test order by 1
RELEASE gcDA,gnGroup,gnCounter

hth,
Frank Camp
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform