Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Request suggestions using Collection class
Message
De
08/12/2003 14:39:07
Larry Long
ProgRes (Programming Resources)
Georgie, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Request suggestions using Collection class
Divers
Thread ID:
00856919
Message ID:
00856919
Vues:
81
I am pulling data into a cursor and an associated value for each field that indicates the value's status, for example

SELECT name, address, zip FROM myTable

and for each field, I have an associated "Current" status (T or F) which is generated in the selection routine.

What I want to do is display a grid showing the cursor and change the background color depending on the associated "Current" value.

I was thinking of doing something along the line of...

DEFINE CLASS RecordSet as Collection

*FOR EACH FIELD IN THE CURSOR
FOR i= 1 to FCOUNT()
STORE FIELD(I) TO fldname

*ADD THE VALUE AND STATUS TO THE RECORDSET COLLECTION
THIS.AddObject(fldname,'RecordValues')

*UPDATE THE VALUES
THIS.&FLDNAME..VALUE = eval('Cursor.'+fldname)
THIS.&FLDNAME..CURRENT = GetFieldStatus()
ENDFOR
ENDDEFINE

DEFINE CLASS RecordValues as Custom
Value=""
Current=.F.
ENDDEFINE

Then define a grid using the recordset and showing a background color based on the Current property.

What I don't want to do, is to have to requery for the status once I get the data as it would take an inordinate amount of time for large recordsets.

Any ideas or comments would be most appreciated.

TIA,
Larry Long
L.A.Long
ProgRes
lalong1@charter.net
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform