Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Method names suggestion
Message
De
14/03/2013 14:20:23
 
 
À
14/03/2013 09:49:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01568344
Message ID:
01568405
Vues:
76
>>Hello,
>>
>>I am using a class which encapsulates most of the cursor handling in FoxPro. For example instead of GO TOP I say loCursor.GoTop() etc.
>>When I scan through a cursor very often I need to save the current position and after the scan move back to the previous record number in that cursor, which would look like this:
>>
>>LOCAL lnRecno
>>lnRecno = loCursor.Recno
>>loCursor.DoSelect()
>>SCAN
>>    *
>>ENDSCAN
>>loCursor.GoTo(lnRecno)
>>
>>I find this a little bit cumbersome, so it would be best to have two methods, one to save the original position and the other to move back to the original position. But I am at a loss how to name those methods, everything I can come up with ("SaveRecordNumber", "MoveBackToRecordNumber") do not sound anything intuitive. Anybody has a bright idea how to name those methods?
>
>SaveRecordPosition() and RestoreRecordPosition()

Lately I've been experimenting with a variation: RecordPositionSave() and RecordPositionRestore(). This follows a logical ( to me ) hierarchy of Object.Attribute.Action. But I'm finding the greatest benefit is this puts related methods next to each other when listed alphabetically, which makes them easier to find.

In this particular case the OP could consider using "Row" instead of "Record" and "Pointer" instead of "Position".
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform