Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Double-entry
Message
De
28/12/1999 12:43:19
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
28/12/1999 10:56:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00308600
Message ID:
00309273
Vues:
29
>Thanks for the code and it appears to work for the most part. A couple of things:
>
>1.) How can I have it to Raise the alarm while there's a difference in the entries (ie a screen that tells them "hey the first time you entered xxxx and the second time you entered aaaaaa. Which one do you want?" and it will display their entries on screen along with push buttons to select which one....I can do the form but I'm stumped on the process)
>
>2.) My forms include more than text boxes. They also include checkboxes and drop lists. How can I have it to check for those as well?
>
>TIA
>
>Jeff T.


Jeff,
I missed it but I think you're talking about "tag" approach. It's a wise way but have shortcomings. Main shortcoming you have to write a good recursion to do it for "all" the controls (controls might be in other containers, like grids, pageframes etc). Or you should subclass all your controls to log to tag property on first pass and catch on second instantly as field about to "lostfocus" (in lostfocus a nodefault would prevent to lose focus).
It's a way but for this I think it's expensive unless you have routines and/or classes ready (still I can post you a recursion that would collect all).
If all is based on cursor-table data then I would suggest doing like this (Buffering is on or off - doesn't matter for this but matters for your save or revert whole) :
* Create a custom form property - say oOldVals
* Or declare it public, as a custom prop. of _screen, oApp etc
*After first pass
scatter name thisform.oOldVals memo && Fields ... if not only one table-view
* Now go for second 
scatter memvar memo blank && blank the fields with these 2 lines 
gather memvar             &&  if you need to
* After second
for ix = 1 to fcount() && If all is one cursor-view-table this is a snap
   if eval(field(ix)) # eval("thisform.oOldVals."+field(ix))
        * Ooops. Diffent data encountered
       ll1st = messagebox( ;
       "1st pass :"+transform( eval("thisform.oOldVals."+field(ix)) )+chr(13) +;
       "2nd pass :"+transform( eval(field(ix)) )+chr(13) +;
       "Revert to first pass ?", ;
        4+48+0,field(ix) + " : Data mismatch") = 6
      if ll1st
        replace (field(ix)) with eval("thisform.oOldVals."+field(ix))
      endif
   endif
endfor
PS: Messagebox() could bomb with long memo data. For general could only differ between empty() and !empty(). Just to show logic.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform