Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Logical record numbers ?
Message
De
25/05/1999 00:10:45
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00222325
Message ID:
00222328
Vues:
20
>Does anyone know how to get the logical record number when you have an index order set. For instance, a customer table is indexed on last name. The 1rst record in the customer table might be the 10th record displayed when the index order is set to last name. I am looking for a quick function that would work like the go command ( ex. gological(10) ).

I don't know how quick this would be, but how about:
cAlias = ALIAS()
cKeyExpn = SYS(14)
uIndexKeyValue = EVAL(cKeyExpn)
nRecNo = RECNO()
SELECT * FROM (cAlias) ;
   WHERE &cKeyExpn < uIndexKeyValue ;
   INTO CURSOR (SYS(2015))
nLogicalRecNo = _TALLY + 1
USE
SELECT (cAlias)
SEEK uIndexKeyValue
*
*  If the key is non-unique, you need to do the following:
*
DO WHILE RECNO() # nRecNo
   nLogicalRecNo = nLogicalRecNo + 1
   SKIP
ENDDO
It's a kludge, but it works...
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform