Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid order - how to prevent jumping?
Message
 
 
À
03/05/2001 15:06:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00502661
Message ID:
00503245
Vues:
18
>>>>Hi Daniel,
>>>>
>>>>Did you read the original question? :) I don't do inserts, I do replace command. Your code will not help me.
>>>>
>>>>Thanks anyway :)
>>>
>>>Hmmm...should have read it with both eyes open, eh?
>>
>>Hi Daniel,
>>
>>Anyway, you got me thinking :) I came up with some idea, though quite combersome. Before do replace I'll call thisform.DetermineNextRecord() method.
>>In this method I would open BldMstr table and save recno of the next record in a form property (or just return it), then do my replace, then move to the record, which should be next.
>
>That's about all I could come up with, too...although you could do something like this in the replace method itself:
>
>
>* assuming you are in the table that you perform the replace in
>lcCurrRec = recno()
>skip
>lcNextRec = recno()
>skip -1
>if lcCurrRec = recno() && hopefully, will always be true
>   * perform the replace
>   GOTO lcNextRec
>endif
>
Ok, this is what I ended up with (works fine in my tests):
********************************************************************
*  Description.......: LendRev.DetermineNextRecord()
*  Calling Samples...: 
*  Parameter List....: 
*  Created by........: Nadya Nosonovsky 05/03/2001 04:42:07 PM 
*  Modified by.......: 
********************************************************************
local lnRecno, lnSelect, lcFilter, lnNewRecno
lnRecno=recno('BldMstr')
lnNewRecno=m.lnRecno
lnSelect=select()
select BldMstr
lcFilter=set('filter')
if !OpenTble(dbf('BldMstr'),"WorkTable",,"LName")
   return m.lnRecno
endif
select WorkTable
if !empty(m.lcFilter)
   set filter to &lcFilter
endif
goto m.lnRecno
if !eof()
  skip
  lnNewRecno=recno()
endif
use in select("WorkTable")
select (m.lnSelect)
return m.lnNewRecno
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform