Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Capture field data with cursor
Message
From
10/12/2009 08:48:00
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
09/12/2009 03:04:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01438152
Message ID:
01438377
Views:
94
>i was afraid it was going to take off in that direction stefan. actually i am working in a browse - dead in the water i should imagine.
>
>k
Not necessarily - a browse IS a grid, it's just that the syntax is different so you don't see (and have a reference to) the grid object being created. But you can have it - browse ... name oMyGrid nowait... is a way for your code to grab a reference to the browse's grid, and even manipulate it.

What is not clear is the generic "information" you want to carry over - is it the whole record, or the contents of the field where the cursor was before closing the form in which you were browsing?

If it's one of the scenarios I was thinking of, you're presenting the user with a browse to select a record, and then when they exit (via closebox), you want to know the last record they were on, right? That should be easy - the browse form should not have a private datasession, but use the default (i.e. whichever was active when it was created), and when the form closes, the caller form can simply pick the current record from the browsed cursor.

If your scenario is a bit complicated. You instantiate the browse form (modal, I presume) with a reference, like Do Form Name oBrowseForm NoShow, or instantiate it from a class and then show() it. Then in the you can grab two events: the AfterRowColChange in the browse's grid (you can bindevent() to it) where you would do

scatter name thisform.oRecord memo

and then you hijack the form's .release(), so when the user wants to close the form, you only hide it, so it exits the oBrowseForm is available when it exits. As the form was modal, the code will wait as long as it's visible; when it hides, code continues running immediately after the oBrowseForm.Show(), where you then take whatever you want from oBrowseForm.oRecord's properties (one for each field in your grid - check what Scatter Name does). Then you can release oBrowseForm.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform