Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scan Endscan pitfall (phantom movement of record pointe
Message
From
30/07/2007 09:30:11
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01244072
Message ID:
01244541
Views:
20
This is usually how I handle it. However, if there is ever the chance that you may remove or filter out records in the recordsource for the grid inside the modal form (or another programmer down the road), then you may want to may sure the recno() exists before returning to it in the grid (errorhandling) and act appropriately if not.


>>>>Steps for this reproducible problem are:
>>>>- Grid connected to table
>>>>- text box in Column in grid has focus
>>>>- Rightclick in column, initiate procedure from a context menu
>>>>- procedure does Scan ALL on _same_ table as in grid, using same workarea
>>>>- during scan loop, after so many records process, pop up a modal VFP form telling user "That's X done so far, keep going?", and get a button click from user
>>>>- little known to me: when modal form closes, activeform and activecontrol (apparently) revert back to the prior form and the grid; grid gets focus; result: record pointer moves back to record where the rightclick was done; scan loop behaves weirdly; can't figure out why, as there is no visible clue this is happening
>>>>- oddly, this resetting of the record pointer only happens the first time the modal form is shown; times after that, no effect
>>>>
>>>>Comments?
>>>
>>>Whenever I'm scanning the grid's recordsource (which I usually don't do!), I open it AGAIN under a different alias, do my thing there, close that alias, go back to the grid. New alias has its own record pointer, buffer etc, so it doesn't interfere with the grid and vice versa.
>>
>>You may also try to do thisform.LockScreen = .t. before the process.
>>
>>I actually did processes with grid's table a while back, but I don't remember having issues Mark described.
>
>What I've found that works and seems easiest so far is:
>if time_to_do_modal_form
>  nRecno=Recno()
>  Do the modal form
>  Goto nRecno
>endif
>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform