Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Proper cursor buffering
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00183097
Message ID:
00183179
Vues:
22
>1. Create a cursor that holds all items available.
>2. Update the cursor with costs that have been previously defined.
>3. Issue =CURSORSETPROP("Buffering",5,"cMycursor") to buffer the cursor.
>4. Present the cursor data to the user for editing via Grid on a form.
>5. Let the user edit the data (edit/define new costs).
>6. Save the data if changes have been made (GETFLDSTATE(-1))
>
>The problem is, after changing the costs on few new items, calling GETFLDSTATE(-1) is returning no changes being made. Since some records have been changed, shoulnd't GETFLDSTATE() return that it did?

I think I see the problem. GETFLDSTATE() gives info about the current record. If you're sitting on an unedited record, GETFLDSTATE() will properly show you that it hasn't been edited, even though other records in the table have been. (Note that -1 specifies all FIELDS in the current RECORD, not all RECORDS in the current TABLE.)

You may want to try this sort of loop, as discussed in the VFP manual under multi-user and buffering issues:
LOCAL CurRecno, NextModRecno
CurRecno = RECNO()
NextModRecno = GETNEXTMODIFIED(0)
DO WHILE NextModRecno != 0
    SavedOK = TABLEUPDATE(.F., .T.)
    DO WHILE NOT m.SavedOK
        * Handle reason save failed.
    ENDDO
ENDDO
HTH,
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform