Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Retrieve top record in a grid
Message
From
30/12/2010 16:17:47
 
 
To
30/12/2010 14:55:07
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01494160
Message ID:
01494193
Views:
52
>Hi Rich,
>
>Yes I am going through 2 free tables to pass variables (external1.dbf) and the displayed records in the grid (external2.dbf)
>the problem I have is to fill the grid data into (external2.dbf)
>let's say there are 15 records in the grid-table but only 8 are visible. I only want to pass over those 8
>
>as a matter of fact the first exe is a POS app and it shows the purchases. Usually there are only a few (it's for liqueur stores) so I pass them all, but in the rare case one byes many items for a big party I want to pass only the current visible record
>
>the second exe is running on the same machine but another monitor to show the customer what is purchased along wth the total, discount tax et. and some PR stuff to make him buy more :-)
>
>in the POS screen is a method calculating all this stuff and maintainng the cursor for the items sold
>this is tha place where I want to fill the external tables
>
>(had all this working using html and IE but that broke when switching to win7 and I could not find a real solution. So I went back to the dual exe (pure VFP) model
>
>Thanks
>
>
>Peter

Do you have a command button on the first exe which is intended to populate external2.dbf? If so, then how about something like
&& Add a form property RelRow

&&Grid.AfterRowColChange
thisform.RelRow = this.RelativeRow 


&&cmdPopulateExternal2.click
SELECT (thisform.myGrid.RecordSource)
lnRecord = RECNO()
lnRows = thisform.RelRow - 1
SKIP -lnRows

lnGridHeight = thisform.myGrid.Height
lnRowHeight = thisform.myGrid.RowHeight
lnHeaderHeight = thisform.myGrid.HeaderHeight

lnRows = INT((lnGridHeight - lnHeaderHeight) / lnRowHeight)
COPY NEXT lnRows TO external2

GOTO lnRecord
I'm not sure how the second exe would know to refresh its data (a timer checking the timestamp on external2???? or a refresh button) but I'm sure you can work out the details for that yourself.

Hope this has been useful............Rich
Previous
Reply
Map
View

Click here to load this message in the networking platform